Giter Site home page Giter Site logo

jscomplexity's Introduction

#JScomplexity

JS cyclomatic complexity report generator.

Command-line tool and module to generate a complexity report on file tree Javascript files. It is based on escomplex module results. Report stands in a .html file containing graphical representation of file tree when used from command-line.

Build Status

###Installation

npm install -g jscomplexity

###Module usage

var jscr = require('jscomplexity');

// jscr() returns a promise (using bluebird)
jscr('/path/to/js/dir').then(console.log);

// you can also use CPS style
jscr('/path/to/js/dir', function(err, result){
  if(err) {
    return console.log(err);
  }
  console.log(result);
});

###Command-line usage

Usage: jscr [options]

  Options:

    -h, --help               output usage information
    -V, --version            output the version number
    -t, --target <folder>    change root folder to analyse - default is current directory
    -s, --skip <pattern>     skip path pattern during tree walk - matched items will be skipped from report
    -o, --output <filename>  customize html report filename - default is 'jscr-report.html'
    -v, --verbose            outputs analysisis logs

โš ๏ธ Linux/OSX compliant only (I haven't tested it on Windows).

Sample outputs (gremlins.js)

Terminal

alt tag

HTML report

alt tag

jscomplexity's People

Contributors

slyg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.