Skip to content

Latest commit

 

History

History
44 lines (38 loc) · 2.03 KB

README.md

File metadata and controls

44 lines (38 loc) · 2.03 KB

JavaScript Code Analyzer

Tells your continuous integration server everything about your JS-code.

This currently only works with Javascript MVC/DoneJS.

Features

  • Outputs a Checkstyle-compatible file, graphs and HTML
  • Shows JSLint-violations
  • Analyzes and warns about cyclomatic complexity
  • Analyzes and warns about short variable names
  • Shows dependencies between objects
  • Shows events shared between objects
  • Shows global code size metrics
  • Works on the command line

Installation

  1. Requirements: Graphviz, JavascriptMVC/DoneJS-project
  2. Copy the whole directory into an analyzer-directory directly below your JS-root-directory.
  3. Configure js/config.js to fit your needs and directory structure.
  4. Call bin/analyze from your continuous integration server.
  5. Analyze output:
  • checkstyle_js.xml: Checkstyle-compatible
  • js-dependencies.html: file containing dependency matrix
  • js-dependencies-d3.html: file containing collapsible dependency graph
  • js-dependencies.svg: file containing detailed dependency graph
  • openajax-events.svg: file containing graph showing OpenAjax-events
  • js-statistics.html: file containing global code size-metrics

Command line usage

analyzer/bin/analyze

Options
  • -h for help
  • -i for interactive mode (re-check on key-press)
  • -s for silent-mode
  • -no-cyclo to disable cyclomatic complexity-check
  • -no-stat to disable printing statistics
  • -c for command-line output

Credits