grunt-plato
grunt-plato copied to clipboard
Generated HTML reports reports functions with cyclomatic complexity 1 even if `maxcyc` is set to 8
The config in my Gruntfile is as below:
plato: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
options: {
jshint: false, //leave jshint to grunt-jshint
// ref: https : //github.com/philbooth/complexity-report
complexity : {
maxcyc : 5,
maxcycden : 100,
maxhd : 100,
maxhv : 100,
maxhe : 100,
logicalor : false,
switchcase : false,
forin : true,
trycatch : true,
newmi : true
},
exclude: /\.min\.js$/ // excludes source files finishing with ".min.js"
},
files: {
'coverage/report/': coverage_code
}
}
},
But, the generated report still highlight functions with cyclomatic complexity 1.
Is there way to limit the report to only highlight functions exceeding thresholds?
No, it should highlight all functions by default with a rundown of stats.
@jsoverson if there is no filtering, what is the maxcyc
argument for?
That's a feature of the consumed library, not necessarily something that plato takes advantage of.