Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>JS Complexity AnalysisNew to Visual Studio Code? Get it now.

JS Complexity Analysis

Tomi Turtiainen

|
13,742 installs
| (3) | Free
Produce a complexity analysis report of your JS project
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JavaScript Complexity Analysis for Visual Studio Code

Uses [ESComplex] to produce a complexity analysis report for a JavaScript project or file. The following [metrics] can calculated:

  • Lines of code
  • Number of parameters
  • Cyclomatic complexity
  • Halstead metrics
  • Maintainability

Installation

  • Install the latest Visual Studio Code.
  • In the command palette (Ctrl-Shift-P or Cmd-Shift-P or F1) select Install Extension and choose JS Complexity Analysis Report.

Usage

This extenson uses typhonjs-escomplex to analyse source files. Currently it utilizes babylon w/ all plugins enabled to analyse source code, so it should support most JS syntax.

Project analysis

GIF

Produces a per function complexity analysis report of all .js files in the project. Open command palette F1 and search for Project complexity analysis.

By default uses project's jsconfig.json configuration for including and excluding files, but files can also be configured using include and exclude glob patterns. Select Code --> Preferences --> User Settings or Workspace Settings. For example:

"complexityAnalysis.exclude": [
    "**/bower_components/**"
],

"complexityAnalysis.include": [
    "**/app/**/*.js"
]

File analysis

Produces a per function complexity analysis report of currently open file. Open command palette F1 and search for File complexity analysis.

Change Log

View

Bugs

Report them here.

Licence

MIT

Acknowledgements

This project is a grateful recipient of the Futurice Open Source sponsorship program. ♥

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft