grunt-complexity
Advanced tools
Comparing version 0.3.1 to 0.4.0
# CHANGELOG | ||
# 0.4.0 | ||
- Throw a more detailed error message in event of an empty source file | ||
(@skoblenick [91dc55f](https://github.com/vigetlabs/grunt-complexity/pull/37/commits/91dc55fa05eea28e78acac2882867c79cc21abc5)) | ||
# 0.3.1 | ||
- Escape PMD violation method names when reporting anonymous functions | ||
(@theoneroof voilation [acfb4e4](https://github.com/theoneroof/grunt-complexity/commit/acfb4e49c363811eb1ee8bae76ebb74442161c76) | ||
(@theoneroof [acfb4e4](https://github.com/theoneroof/grunt-complexity/commit/acfb4e49c363811eb1ee8bae76ebb74442161c76)) |
{ | ||
"name": "grunt-complexity", | ||
"description": "Evaluates code maintainability using Halstead and Cyclomatic metrics.", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/vigetlabs/grunt-complexity.git", | ||
@@ -18,7 +18,4 @@ "author": { | ||
}, | ||
"licences": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://opensource.org/licenses/MIT" | ||
} | ||
"license": [ | ||
"MIT" | ||
], | ||
@@ -42,5 +39,5 @@ "main": "grunt.js", | ||
"grunt-complexity": "https://github.com/vigetlabs/grunt-complexity/tarball/master", | ||
"grunt-contrib-jshint": "0.1.x", | ||
"grunt-simple-mocha": "0.3.x", | ||
"mocha": "~1.8.1", | ||
"grunt-contrib-jshint": "~1.0.0", | ||
"grunt-simple-mocha": "~0.4.1", | ||
"mocha": "~3.0.2", | ||
"sinon": "^1.10.2" | ||
@@ -47,0 +44,0 @@ }, |
@@ -5,3 +5,2 @@ # Grunt-Complexity | ||
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/vigetlabs/grunt-complexity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Build Status](https://travis-ci.org/vigetlabs/grunt-complexity.svg)](https://travis-ci.org/vigetlabs/grunt-complexity) | ||
@@ -26,3 +25,3 @@ | ||
```bash | ||
npm install grunt-complexity --save | ||
npm install grunt-complexity --save-dev | ||
``` | ||
@@ -29,0 +28,0 @@ |
@@ -143,2 +143,7 @@ /*global module:false*/ | ||
var content = grunt.file.read(filepath); | ||
if (!content.length) { | ||
throw new Error('Empty source file: \'' + filepath + '\'.'); | ||
} | ||
return { | ||
@@ -145,0 +150,0 @@ filepath: filepath, |
@@ -18,2 +18,13 @@ describe("Complexity task", function() { | ||
it ('throws an error when encountering an empty file', function () { | ||
var targetFile = __dirname + '/fixtures/empty.js'; | ||
var reporter = { | ||
start: function () {} | ||
}; | ||
expect(function () { | ||
cut.analyze(reporter, [targetFile], null); | ||
}).to.throw('Empty source file: \'' + targetFile + '\'.'); | ||
}); | ||
describe("isComplicated", function() { | ||
@@ -20,0 +31,0 @@ var data = { |
368409
111
5254
122