Automating code review on commit

HOW TO AUTOMATE CODE REVIEWS ON COMMITS

Imagine the hustle of spending hours on code review every day. Code review automation may save countless wasted efforts.

This Article may walk you through steps on how to add automated code reviews that may be executed during every code commit.

Codacy is one of the tools that may be used to achieve this.

Codacy is an automated code review tool that helps developers ship better software, faster. With Codacy, you get static analysis, cyclomatic complexity, duplication, and code unit test coverage changes in every commit and pull request.

Steps to integrate your project with Codacy

1. Sign up

You may use your Git provider such as GitHub, GitLab, or Bitbucket to sign up to Codacy. This links your Codacy user with your Git provider user, making it easier to add repositories to Codacy and invite your teammates.

sign up

2. Grant access

Codacy will request access to your Git provider and will require you to provide a few details regarding your organization. (this helps them on use case evaluation).

grant access

3. Choose organization

Now you will be required to join the organizations that contain your repositories

Note:

codacy name the organizations similar to your git repository user name.

Example If your repository is “github.com/Fruitsandvegies”. Then the name of your organization will be “Fruitsandvegies”.

choose organization

4. Adding repository

By selecting the organization on step 3, codency will list all related repositories available. Select the “add” option to add the repository for review. Codancy will immediately set up everything so as to be ready to analyze on the next commit.

Note:

You can add the repository to Codancy only if you have permission to that repository.

adding repository

5. Review result of the analysis

Select “Go to repository” once the analysis has completed reviewing the results.

Detailed analysis result

review result of the analysis

The initial analysis from Codancy will be based on the default configuration. Codacy provides tweaks to allow you to set up a custom configuration such as files to ignore, code pattern, and adjust quality settings.