vigetlabs/grunt-complexity

Fix comparisson of 'maintainability' values

davidlinse opened this issue · 5 comments

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 ?

Gross. I'm going to look into this now

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?

Thanks for taking care of this.

As for the Math.rounds

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

~david

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

👍 thanks for taking care ..