1

I am currently trying to compare the TodoMVC Examples of Angular, Ember, Backbone and Knockout with the help of code metrics. After some research, I found jsmeter.info and jscomplexity.org which both cover the metrics i would like to compare. (Lines of Code, Cyclomatic Complexity, Halstead Metrics, Maintainability Index)

My problem here is that I have to analyze every file on it's own and I couldn't manage to find out how I can aggregate the outputs of the different files, that there is just one result at the end for every implementation of TodoMVC.

So for Lines of Code it's easy, I just have to add them, but I'm pretty sure that this is not applicable for the other metrics. Do I have to take the average or is there a better way to find a meaningful result?

Thank you in advance.

areiterer
  • 33
  • 1
  • 7

1 Answers1

0

You should try out escomplex. It works on AST (Abstract syntax tree) conforming to the SpiderMonkey Parser API, which can be produced by e.g. the Esprima parser.

Rudolf FERENC
  • 289
  • 1
  • 6
  • Thank you, jscomplexity.org is based on excomplex. I'm aggregating the output of every js File for one TodoMVC implementation and compare it with the other aggregations of the other TodoMVC implementations. So for example I add the Lines of Code for all JS-Files for AngularJS-TodoMVC and I take the average of Cyclomatic Complexity, the average of Halstead Metrics, etc. so my comparison is based on these values. Thank you. – areiterer Nov 18 '14 at 17:43