Skip to content

smcommits/CodeAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Ruby Code Analyzer

Issues Pull Requests License

AboutPrerequisitesAvailable InspectionsGetting StartedUnder The HoodContributingAuthorsLicense


About

This repository contains a static code analyzer tool for Ruby source code. It inspects the code for styling and complexity errors. This tool aims to help enforce appropriate programming practices.

Prerequisites

To use the program Parser and Colorize gems must be installed on the local machine.

To install parser gem, run the following command in the terminal emulator.

gem install parser

To install Colorize gem, run the following command in the terminal emulator.

gem install colorize

Available Inspections

Please refer to this documentation to understand all the inspection features.

Getting Started

Step 1

To get started you have to clone the repo on your local machine. To clone the repo run the following command in a terminal emulator:

git clone https://github.com/smcommits/CodeAnalyzer

Alternatively, you can click this link to download the repo as a zip file.

Step 2

Now navigate to the bin directory using the following command

cd bin

Step 3

Run the linter by executing main.rb file using the followed by the path to your file. You can also run -h to get help.

./main.rb path/to/your/file

Example:

./main.rb ~/code/my_ruby_code.rb

After executing, the tool will inspect for any errors and display the error location, type, and message.

Linter GIF

Under the hood

This project uses Abstract Syntax Tree and Lexical Analysis to analyze the code for errors. Parser gem is used to implement the solutions requiring AST, and ruby Ripper library is used to implement the solutions that require lexical analysis.

Authors

👤 Anas Siddiqui

🤝Contributing

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

Colorize Gem

To add colors to the user interface.

Inspection Logo

Icons made by Eucalyp from www.flaticon.com

Disclaimer

This project is still very new and will not produce completely accurate results. Therefore, it should not be your primary source of linting. If you are looking for a Ruby source code linter, then use Rubocop

License

This project is MIT licensed.

About

A static code analyzer tool for Ruby source code. It inspects the code for styling and complexity errors.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages