GithubHelp home page GithubHelp logo

slyg / jscomplexity Goto Github PK

View Code? Open in Web Editor NEW
30.0 6.0 4.0 565 KB

๐Ÿ’ค [Not maintained] JS cyclomatic complexity report generator

JavaScript 50.51% CoffeeScript 10.03% HTML 39.45%
cyclomatic-complexity javascript unmaintained

jscomplexity's Introduction

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'

โš ๏ธ 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.

jscomplexity's People

Contributors

igorshubovych avatar slyg avatar tom-sap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jscomplexity's Issues

HTML report hangs in Firefox and Chrome

I'm running jscomplexity 2.0.0, and the HTML reports hang while rendering in the browser. Eventually, FF comes back w/a message that the script: http://cdnjs.cloudflare.com/ajax/libs/graphael/0.5.0/g.raphael-min.js may be busy or have stopped responding. I can only regain control of the browser by stopping the script.

The 3 scripts and 1 css on cloudflare all load w/a 200 status.

Running FF 44.0.2. Chrome 49.0.2623.87 64bit. On a mac. Same thing happens in Safari 9.1.

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.