Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jansanchez/jscomplex
A colorful reporter for maintainability index via escomplex
https://github.com/jansanchez/jscomplex
Last synced: 9 days ago
JSON representation
A colorful reporter for maintainability index via escomplex
- Host: GitHub
- URL: https://github.com/jansanchez/jscomplex
- Owner: jansanchez
- License: mit
- Created: 2016-03-04T22:06:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-09T17:11:03.000Z (over 8 years ago)
- Last Synced: 2024-10-11T23:28:52.158Z (26 days ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/jscomplex
- Size: 500 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jscomplex [![NPM version][npm-image]][npm-url]
A colorful reporter for maintainability index via escomplex![jscomplex basic use](docs/images/jscomplex-basic-use.png)
## Install Globally
```
sudo npm install jscomplex -g
```## Install like a development dependency
```
npm install --save-dev jscomplex
```## How to use
![jscomplex](docs/images/jscomplex.gif)
## Use it from `npm scripts`
`package.json`
```json
"scripts": {
"complex": "jscomplex ./js/**/*.js"
}
```Then in a terminal:
```bash
npm run complex
```## Or Use from terminal
```
jscomplex "['./lib/*.js', './bin/*.js']"
```## Pre-requisites
node version >= 4.0.0
## Help
```
jscomplex -h
```
*Output*```bash
Usage: jscomplex [options]Options:
-h, --help output usage information
-V, --version output the version number
-j, --json specify json as the output format of the report
-M, --mi specify the per-module maintainability index threshold
-l, --logicalor disregard operator || as source of cyclomatic complexity
-w, --switchcase disregard switch statements as source of cyclomatic complexity
-i, --forin treat for...in statements as source of cyclomatic complexity
-t, --trycatch treat catch clauses as source of cyclomatic complexity
-n, --newmi use the Microsoft-variant maintainability index (scale of 0 to 100)
-Q, --nocoresize don't calculate core size or visibility matrixExamples:
# Analize all *.js files from "lib" folder
$ jscomplex "['./lib/*.js']"# Analize all *.js files from "lib" and "bin" folder
$ jscomplex "['./lib/*.js', './bin/*.js']"# Analize all *.js files
$ jscomplex "['./**/*.js']"
```## Enjoy it!
[npm-image]: http://img.shields.io/npm/v/jscomplex.svg
[npm-url]: https://www.npmjs.org/package/jscomplex