This is a bit of an edge case, but I was using this on a project with a lot of files and sub directories and was using file globbing to send them all through
Whenever I ran the grunt task it would immediately spit out a
Warning: invalid source Use
Without outputting anything else, this was driving me mad until I went through file by file and found an empty .js file
Apparently complexity-report does not like zero length files and the very first line tosses that error, not sure how to get the task to continue without without doing a real hack (below)
A very minor change would allow it to continue which might not be the way to go, but since this is a few rev's behind it might okay until things catch up
files.map(function(filepath) {
var content = grunt.file.read(filepath);
// *** Add a space if content is empty so cr.run will continue
if (!content.length) {
content = ' ';
}
return {
filepath : filepath,
analysis : cr.run( content, options )
};
.
.
.
If you think it makes sense I can do a PR and submit a change for review
This is a bit of an edge case, but I was using this on a project with a lot of files and sub directories and was using file globbing to send them all through
Whenever I ran the grunt task it would immediately spit out a
Without outputting anything else, this was driving me mad until I went through file by file and found an empty .js file
Apparently complexity-report does not like zero length files and the very first line tosses that error, not sure how to get the task to continue without without doing a real hack (below)
A very minor change would allow it to continue which might not be the way to go, but since this is a few rev's behind it might okay until things catch up
If you think it makes sense I can do a PR and submit a change for review