NEW `grunt complexity` reporting task
Thomas Aylott committed
Nov 26, 2013 at 14:56 UTC
2b3e97b5a45572fadc07dfd6ffbfbe591af2656a
3 files changed
+13
-2
Gruntfile.js
+2
-1
@@ -23,7 +23,8 @@ module.exports = function(grunt) {
23
npm: require('./grunt/config/npm'),
24
clean: ['./build', './*.gem', './docs/_site', './examples/shared/*.js', '.module-cache'],
25
jshint: require('./grunt/config/jshint'),
26
- compare_size: require('./grunt/config/compare_size')
26
+ compare_size: require('./grunt/config/compare_size'),
27
+ complexity: require('./grunt/config/complexity')
28
});
29
30
grunt.config.set('compress', require('./grunt/config/compress'));
grunt/config/complexity.js
new
+9
@@ -0,0 +1,9 @@
1
+module.exports.generic = {
2
+ src: ['./build/modules/**/*.js'],
3
+ options: {
4
+ errorsOnly: false, // show only maintainability errors
5
+ cyclomatic: 3,
6
+ halstead: 8,
7
+ maintainability: 100
8
+ }
9
+};
package.json
+2
-1
@@ -59,7 +59,8 @@
59
"es5-shim": "~2.1.0",
60
"wd": "~0.2.2",
61
"sauce-tunnel": "~1.1.0",
62
- "coverify": "~0.1.1"
62
+ "coverify": "~0.1.1",
63
+ "grunt-complexity": "~0.1.3"
64
},
65
"engines": {
66
"node": ">=0.10.0"