Hi all,
To scratch an itch I've been having on another project, I've started to build a complexity analysis tool on top of Esprima:
It's currently still quite naive, simply tracking cyclomatic complexity as it walks the syntax tree, but work is under way to add Halstead measures and the Maintainability Index.
There is some configuration available to set how complexity is calculated and a threshold may also be set to make the process fail if functions beyond a specified complexity are encountered.
Bug reports, pull requests or just thoughts are extremely welcome! :)
Phil