{"id":22423427,"url":"https://github.com/prantlf/grunt-escomplex-report","last_synced_at":"2025-03-27T05:41:03.053Z","repository":{"id":57255001,"uuid":"119378472","full_name":"prantlf/grunt-escomplex-report","owner":"prantlf","description":"Software complexity analysis for JavaScript projects.","archived":false,"fork":false,"pushed_at":"2019-12-27T12:46:13.000Z","size":201,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T09:16:57.262Z","etag":null,"topics":["complexity","cyclomatic-complexity","grunt-task","halstead-complexity","maintainability"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-29T12:16:51.000Z","updated_at":"2019-09-24T06:22:38.000Z","dependencies_parsed_at":"2022-09-04T14:12:57.169Z","dependency_job_id":null,"html_url":"https://github.com/prantlf/grunt-escomplex-report","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-escomplex-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-escomplex-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-escomplex-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-escomplex-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/grunt-escomplex-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791899,"owners_count":20672668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["complexity","cyclomatic-complexity","grunt-task","halstead-complexity","maintainability"],"created_at":"2024-12-05T18:11:18.305Z","updated_at":"2025-03-27T05:41:03.036Z","avatar_url":"https://github.com/prantlf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-escomplex-report\n\n[![NPM version](https://badge.fury.io/js/grunt-escomplex-report.png)](http://badge.fury.io/js/grunt-escomplex-report) \n[![Build Status](https://travis-ci.org/prantlf/grunt-escomplex-report.svg?branch=master)](https://travis-ci.org/prantlf/grunt-escomplex-report)\n[![Coverage Status](https://coveralls.io/repos/github/prantlf/grunt-escomplex-report/badge.svg?branch=master)](https://coveralls.io/github/prantlf/grunt-escomplex-report?branch=master)\n[![Dependency Status](https://david-dm.org/prantlf/grunt-escomplex-report.svg)](https://david-dm.org/prantlf/grunt-escomplex-report)\n[![devDependency Status](https://david-dm.org/prantlf/grunt-escomplex-report/dev-status.svg)](https://david-dm.org/prantlf/grunt-escomplex-report#info=devDependencies)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\n[![NPM Downloads](https://nodei.co/npm/grunt-escomplex-report.png?downloads=true\u0026stars=true)](https://www.npmjs.com/package/grunt-escomplex-report)\n\nSoftware complexity analysis for JavaScript projects.\n\n# Table of Contents\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [Task Options](#task-options)\n  - [Task Data](#task-data)\n  - [Loading](#loading)\n- [Build](#build)\n- [Contributing](#contributing)\n- [Release History](#release-history)\n- [License](#license)\n\n## Installation\n\nYou need [node \u003e= 4][node], [npm] and [grunt \u003e= 0.4.5][Grunt] installed\nand your project build managed by a [Gruntfile] with the necessary modules\nlisted in [package.json]. If you haven't used Grunt before, be sure to check out the [Getting Started] guide, as it\nexplains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this\ncommand:\n\n```shell\n$ npm install grunt-escomplex-report --save-dev\n```\n\n## Configuration\n\nAdd the `escomplex-report` entry with the task configuration to the options of the `grunt.initConfig` method:\n\n```js\ngrunt.initConfig({\n  'escomplex-report': {\n    all: {\n      src: ['../../src/**/!(*.spec)+(.js)'],\n      options: {\n        output: 'complexity.txt'\n      }\n    }\n  }\n});\n```\n\nDefault options support the most usual usage scenario:\n\n```js\n'escomplex-report': {\n  options: {\n    format: 'plain',\n    output: null,\n    onlyfailures: true,\n    silent: false,\n    newmi: true,\n    force: false\n  },\n  ...\n}\n```\n\n### Task Options\n\n#### force\nType: `Boolean`\nDefault value: false\n\nIf set to `true`, it suppresses complexity failures. Instead of making the Grunt fail, the errors will be written only to the console.\n\n#### format: \u003cformat\u003e\nType: `String`\nDefault value: null\n\nSpecify the output format of the report.\n\n#### output \u003cpath\u003e\nType: `String`\nDefault value: null\n\nSpecify an output file for the report.\n\n#### ignoreerrors\nType: `Boolean`\nDefault value: false\n\nIgnore parser errors.\n\n#### maxfiles \u003cnumber\u003e\nType: `Number`\nDefault value: 1024\n\nSpecify the maximum number of files to have open at any point.\n\n#### maxfod \u003cfirst-order density\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-project first-order density threshold.\n\n#### maxcost \u003cchange cost\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-project change cost threshold.\n\n#### maxsize \u003ccore size\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-project core size threshold.\n\n#### minmi \u003cmaintainability index\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-module maintainability index threshold.\n\n#### maxcyc \u003ccyclomatic complexity\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-function cyclomatic complexity threshold.\n\n#### maxcycden \u003ccyclomatic density\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-function cyclomatic complexity density threshold.\n\n#### maxhd \u003chalstead difficulty\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-function Halstead difficulty threshold.\n\n#### maxhv \u003chalstead volume\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-function Halstead volume threshold.\n\n#### maxhe \u003chalstead effort\u003e\nType: `Number`\nDefault value: null\n\nSpecify the per-function Halstead effort threshold.\n\n#### onlyfailures\nType: `Boolean`\nDefault value: true\n\nReport only modules and functions, which failed the complexity checks.\n\n#### silent\nType: `Boolean`\nDefault value: false\n\nDo not write any output to the console.\n\n#### logicalor\nType: `Boolean`\nDefault value: false\n\nCisregard operator || as source of cyclomatic complexity.\n\n#### switchcase\nType: `Boolean`\nDefault value: false\n\nDisregard switch statements as source of cyclomatic complexity.\n\n#### forin\nType: `Boolean`\nDefault value: false\n\nTreat for...in statements as source of cyclomatic complexity.\n\n#### trycatch\nType: `Boolean`\nDefault value: false\n\nTreat catch clauses as source of cyclomatic complexity.\n\n#### newmi\nType: `Boolean`\nDefault value: true\n\nUse the Microsoft-variant maintainability index (scale of 0 to 100).\n\n#### nocoresize\nType: `Boolean`\nDefault value: false\n\nDo not calculate core size or visibility matrix.\n\n### Task Data\n\n#### src\nType: `String|Array|Object`\nDefault value: []\n\nSource files to have their complexity checked. Grunt file list specification.\n\n### Loading\n\nLoad the plugin in `Gruntfile.js`:\n\n```javascript\ngrunt.loadNpmTasks('grunt-escomplex-report');\n```\n\n## Build\n\nCall the `escomplex-report` task:\n\n```shell\n$ grunt escomplex-report\n```\n\nor integrate it to your build sequence in `Gruntfile.js`:\n\n```js\ngrunt.registerTask('default', ['escomplex-report', ...]);\n```\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding\nstyle. Add unit tests for any new or changed functionality. Lint and test\nyour code using Grunt.\n\n## Release History\n\n * 2018-05-03  [v1.0.1]  Supported installation if NPM proxy cache is used\n * 2018-04-27  [v1.0.0]  Dropped support of Node.js 4\n * 2018-01-29  [v0.0.1]  Initial release\n\n## License\n\nCopyright (c) 2018-2019 Ferdinand Prantl\n\nLicensed under the MIT license.\n\n[node]: https://nodejs.org\n[npm]: https://npmjs.org\n[package.json]: https://docs.npmjs.com/files/package.json\n[Grunt]: https://gruntjs.com\n[Gruntfile]: https://gruntjs.com/sample-gruntfile\n[Getting Gtarted]: https://github.com/gruntjs/grunt/wiki/Getting-started\n[v0.0.1]: https://github.com/prantlf/grunt-escomplex-report/releases/tag/v0.0.1\n[v1.0.0]: https://github.com/prantlf/grunt-escomplex-report/releases/tag/v1.0.0\n[v1.0.1]: https://github.com/prantlf/grunt-escomplex-report/releases/tag/v1.0.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fgrunt-escomplex-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Fgrunt-escomplex-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fgrunt-escomplex-report/lists"}