Wednesday, April 17, 2013

Plato: a JavaScript source code visualization, static analysis, and complexity tool

To improve the quality of my JavaScript code, I’m always looking at good tools (like JsLint) that can help me writer better code and more maintainable code.

Last week I discovered Plato,a JavaScript source code visualization, static analysis, and complexity tool.

This node.js module analyses your JavaScript code and gives you an indication about:

  • The maintainability of your code
  • Lines of code
  • Estimated errors in implementation(based on the Halstead complexity measures)
  • Lint errors(based on the results of JsHint)

Get started

  • Download and install node.js from the node.js website(
  • Start a command prompt
  • Install plato as a global module through the npm package manager: npm install -g plato


  • Browse to the folder where you want to run Plato.
  • Call Plato and specify to do a recursive scan on the scripts folder:  plato -r -d reports scripts
  • Go to the reports folder and open the index.html page to see the results(here you see an example run on Marionette.js):



Open source static analysis tools said...

Very informative blog. This blog provide nice information about javaScript source static analysis tools. Thanks for sharing

Saju Thankathurai said...

Is there any alternative to Plato? I need to know why Plato is more powerful than others?