I am using JSHint and I want to turn off cyclomatic complexity.
How can I do this?
Let's say our function is named x. Then we should just write this :
function x () {
/*jshint maxcomplexity:6 */
}
Where 6 is number js hint usually says it in console like this:
static/desktop.blocks/days/days.js: line 57, col 27, This function's cyclomatic complexity is too high. (6)
I tried at the top of my file to put the following:
/*jshint maxcomplexity:0 */
And was told
Expected a small integer or 'false' and instead saw '0'.
So then tried the following
/*jshint maxcomplexity:false */
And found that it does turn off the cyclomatic complexity warnings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With