2.0.0 • Published 8 years ago

jscomplexity v2.0.0

Weekly downloads
47
License
MIT
Repository
github
Last release
8 years ago

#JScomplexity

JS cyclomatic complexity report generator.

Command-line tool and module that generates a report of Javascript files complexity. It is based on escomplex module's results.

In 'html' mode, command-line tool will create an .html file report containing graphical representation of files complexity and lines of code count.

Build Status

###Installation

npm install -g jscomplexity

###Module usage

var jscomplexity = require('jscomplexity');

// jscomplexity() returns a promise (using bluebird)
jscomplexity('/glob/pattern/to/js/*' [, globOptions]).then(console.log);

// you can also use CPS style
jscomplexity('/glob/pattern/to/js/*', {}, function(err, result){
  if(err) {
    return console.log(err);
  }
  console.log(result);
});

###Command-line usage

Usage: jscomplexity [options]

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -p, --pattern <pattern>    glob pattern - default is current directory
    -o, --output <filename>    (optional) customize html report filename - default is 'jscomplexity-report.html'
    -r, --reporter <reporter>  (optional) specify a reporter: 'terminal', 'html' or 'all' - default is 'terminal'

:warning: Linux/OSX compliant only (I haven't tested it on Windows).

CLI Example : jscomplexity -p '{src/*.js,src/**/*.js,!src/config/**}'

Sample outputs (gremlins.js)

Terminal

alt tag

HTML report

alt tag

Grunt task

See grunt-jscomplexity-threshold module.

2.0.0

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.3

9 years ago

0.1.2

10 years ago

0.1.0

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago