complexity-report
Advanced tools
Comparing version 0.6.1 to 0.6.2
{ | ||
"name": "complexity-report", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"author": "Phil Booth <pmbooth@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "A tool for reporting code complexity metrics in JavaScript projects.", |
@@ -14,3 +14,3 @@ # complexityReport.js | ||
The tool can be configured to fail | ||
when cyclomatic complexity passes a specified threshold, | ||
when complexity metrics pass a specified threshold, | ||
to aid its usefulness in automated environments / CI. | ||
@@ -76,4 +76,5 @@ There are also options | ||
Currently there are three output formats supported: | ||
Currently there are four output formats supported: | ||
`plain`, | ||
`minimal`, | ||
`json` | ||
@@ -133,8 +134,9 @@ and `xml`. | ||
* [Gleb Bahmutov][gleb]'s [js-complexity-viz] | ||
is a wrapper for complexityReport.js, | ||
which uses the Google Visualization API | ||
to render complexity charts | ||
for all JavaScript files in a directory tree. | ||
There are two projects | ||
that generate chart visualizations | ||
of complexiytReport.js metrics: | ||
* [Gleb Bahmutov][gleb]'s [js-complexity-viz]; | ||
* [Jarrod Overson][jarrod]'s [Plato]. | ||
## Development | ||
@@ -195,2 +197,4 @@ | ||
[js-complexity-viz]: https://github.com/bahmutov/js-complexity-viz | ||
[jarrod]: http://jarrodoverson.com/blog/about | ||
[plato]: https://github.com/jsoverson/plato | ||
[tracker]: https://github.com/philbooth/complexityReport.js/issues | ||
@@ -197,0 +201,0 @@ [node]: http://nodejs.org/ |
@@ -305,3 +305,3 @@ /** | ||
(data.operators.distinct / 2) * | ||
(data.operands.total / data.operands.distinct); | ||
(data.operands.distinct === 0 ? 1 : data.operands.total / data.operands.distinct); | ||
data.volume = data.length * (Math.log(data.vocabulary) / Math.log(2)); | ||
@@ -308,0 +308,0 @@ data.effort = data.difficulty * data.volume; |
/*jshint nomen:false */ | ||
/*globals require, __dirname, exports */ | ||
/*globals require, exports, __dirname */ | ||
@@ -7,3 +7,2 @@ 'use strict'; | ||
var fs = require('fs'), | ||
path = require('path'), | ||
loaded = false, | ||
@@ -10,0 +9,0 @@ syntaxModules = []; |
Sorry, the diff of this file is too big to display
142896
3026
204