Skip to content

Commit

Permalink
adding complexity task
Browse files Browse the repository at this point in the history
  • Loading branch information
AutoSponge committed Oct 4, 2013
1 parent ca71ffb commit 94b6a94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = function(grunt) {
jshint: {
files: ['Gruntfile.js', 'features/step_definitions/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
Expand All @@ -26,10 +25,23 @@ module.exports = function(grunt) {
},
qunit: {
all: ['src-test/*.html', 'example-test/*.html']
},
complexity: {
generic: {
src: 'src/stack.js',
options: {
errorsOnly: false,
cyclomatic: 10, //high threshold on purpose
halstead: 20, //high threshold on purpose
maintainability: 130 //high standard
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-complexity');
grunt.registerTask('complex', 'complexity');
grunt.registerTask('default', ['jshint', 'qunit', 'uglify']);
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-qunit": "~0.1.1"
"grunt-contrib-qunit": "~0.1.1",
"grunt-complexity": "~0.1.3"
}
}

0 comments on commit 94b6a94

Please sign in to comment.