Getting script complexity

Nov 18, 2011 at 2:04 AM

Hello,

Is there a way to get an evaluation of the script's complexity (like cyclomatic complexity) ?
If not, any hint about how to hook some complexity evaluator to the Parser ?

Thanks
Thomas

 

Coordinator
Nov 18, 2011 at 9:45 AM

Nope, there is no functionality like that.  If you were looking to build such a system you could definitely use the Jurassic lexer and parser as a starting point.  The code files you would need are under:

  • Jurassic\Compiler\Lexer
  • Jurassic\Compiler\Parser
  • Jurassic\Compiler\Expressions
  • Jurassic\Compiler\Statements

(There may be others)

Good luck!