Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why don't you use better formula? #13

Open
rookiePrgrmer opened this issue Feb 2, 2019 · 1 comment
Open

why don't you use better formula? #13

rookiePrgrmer opened this issue Feb 2, 2019 · 1 comment

Comments

@rookiePrgrmer
Copy link

rookiePrgrmer commented Feb 2, 2019

In the origin paper, wrote by Paul Oman, they improved the original formula which used in escomplex-plugin-metrics-module.

The formula used in escomplex-plugin-metrics-module is:

Maintainability = 171
- 3.42 * ln(aveE)
- 0.23 * aveV(g')
- 16.2 * ln(aveLOC) + aveCM

and the improved version is:

Maintainability = 171
- 5.2 * ln(aveVol)
- 0.23 * aveV(g')
- 16.2 * ln(aveLOC)
+ ( 50 * sin(√2.46 * perCM) )

More details refer to Using Metrics to Evaluate Software System Maintainability.

@typhonrt
Copy link
Member

typhonrt commented Feb 2, 2019

@rookiePrgrmer more or less I inherited typhonjs-escomplex from a previous abandoned fork of an abandoned original project. So the decision for this particular formula was inherited as well. A lot of my contribution was rearchitecting the old code to ES6+ and improving coverage of more modern JS / AST nodes initially w/ ES6 support and get it to work with all the major AST parsers (5 of them right now!) and vastly expanding the number of tests performed for ES6+. I did tweak how some of the stats were calculated given my general readings on the standard metrics gathered and did my best when I added new coverage capabilities. There are definitely a lot of flaws seemingly in the previous two projects. With the 0.1.0 update the latest Babel parser is used and Typescript is also supported.

I could use help on refining the metric gathering functionality especially for Typescript coverage (no Typescript AST nodes are processed currently). As things go I had to abandon a considerable amount of work in progress from a couple of years ago due to a family situation and when I got back to things recently for the 0.1.0 release I simply merged what was in the queue from a while back, so some inaccuracy crept into the stats; some of the aggregate calculations are off seemingly, so I need to give them a good look. 0.1.0 updated the AST parser and brought all the necessary changes to still support all 5 parsers as well.

I plan to be making a 0.2.0 stability update in a week or so on the 12-14th. I'll be taking an in depth look at the correctness of the stats generated with this release. I'll evaluate updating the maintainability formula. If you see anything else that could be improved do let me know. A follow up 0.3.0 release will have coverage for Typescript. A good deal more work will follow later in the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants