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)
- 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
- 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