Automated Code Review – JavaScript

Today, I will provide example of performing a quick and easy way to conduct automated code review on your javascript source.

Pre-requisite

Nodejs and NPM

Install Plato (One time setup)

Plato is a “JavaScript source code visualization, static analysis and complexity tool”

Run the following command in your

  • Command Prompt (Windows)
    • npm install -g plato
  • Terminal (Mac)
    • sudo npm install -g plato
    • You would be asked to type your system’s password

Analyze the code

  • Open Terminal (Or Command Prompt in Windows)
  • CD to the project root directory (or to www where your javascript files are stored)
  • Run following command
    • plato -r -d reports ./
  • Access the reports in directory named “reports”

Pro tips

If you run the plato check often during development, the report will show the changes (positive / negative) in the number of issues being reported. And the underlying jshint review tool is completely configurable to include / exclude various checks. Read manual in the links supplied.

#HappyCoding

@RahulChoudhary

Sample Report

Screen Shot 2015-03-11 at 9.58.17 AM.png

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply