vigetlabs / grunt-complexity

A JavaScript complexity analysis grunt task.
MIT License
221 stars 22 forks source link

Fix comparisson of 'maintainability' values #28

Closed davidlinse closed 10 years ago

davidlinse commented 10 years ago

The task will fail even the data.maintainability value matches the options.maintainability.

// tasks/complexity.js
isMaintainable: function(data, options) {
    var expected = options.maintainability;  // 123.42
    var actual = data.maintainability;  // 123.42
    return expected < actual;  // task will fail
},

I guess it should be more like

return expected <= actual;  // task will success

What do you think ?

PS: I also saw some Math.round()'s in the test/, so maybe there is something uncovered ?

nhunzaker commented 10 years ago

Gross. I'm going to look into this now

nhunzaker commented 10 years ago

Okay. This should be addressed with c819c79. As for the Math.rounds, I am not clear where this is occurring. Could you direct me to where this is?

davidlinse commented 10 years ago

Thanks for taking care of this.

As for the Math.rounds

Sorry, was in the tests of complexity-report ..

~david

nhunzaker commented 10 years ago

Your welcome! This just shipped (v0.1.71)!

davidlinse commented 10 years ago

:+1: thanks for taking care ..