Last active
August 29, 2015 14:23
-
-
Save sscovil/e0029dc1ef75bfc65439 to your computer and use it in GitHub Desktop.
Gulp task that analyzes source code complexity, generates a report, then opens an HTML visualization of the data in your default browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); // https://www.npmjs.com/package/gulp | |
var plato = require('plato'); // https://www.npmjs.com/package/plato | |
var open = require('open'); // https://www.npmjs.com/package/open | |
// Override defaults by setting node environment variables: $ SRC='./js/**/*.*' DEST='./info' gulp report | |
var src = process.env.SRC || './src/**/*.*'; | |
var dest = process.env.DEST || './report'; | |
gulp.task('report', function() { | |
plato.inspect(src, dest, {}, callback); | |
function callback(report) { | |
open(dest + '/index.html'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment