There’s an interessting tool that allows flex developers to automatically test their code quality, identifying unused variables and functions, too complex code etc. Commandline, Ant and OSX Automator versions are available at:

http://opensource.adobe.com/wiki/display/flexpmd/Downloads