Continuous Integration: code quality and code review tools

Continuous integration best practices tools

3 min read ⋅ 180 views

Code review in the software development world is a process of reviewing the source code. Code review could be done in different forms such as walkthroughs, Fagan inspection, pair programming, continuous code review. The main idea behind code review is to find code mistakes and improve the quality of the software. Code review can often help developers to find vulnerabilities such as race conditions, memory leaks, string vulnerabilities, buffer overflows, and helps them to improve software security. Online software repositories based on Git or Subversion allow groups of developers and contributors to collaboratively make a review or check the quality of the source code by using CI tools.

Using automated software tools could help you review, and check for quality of large code chunks by automating the process. In this article, we will make a short overview of some of the CI quality and code review tools that could help you to automate code review, check for code quality, find security vulnerabilities, and get test coverage reports.

Codacy

Codacy is an automated code quality tool that integrates with GitHub repositories and could help developers to create better software. It will do static analysis, check for DRY or duplication code, and cover unit test coverage changes for every commit and pull request on the repository. Also, it will save you time in code reviews, check for security best practices and code quality standards. Supported languages are Python, Java, PHP, Go, JavaScript, Scala, Ruby, Swift, TypeScript, Shell.

Pricing and setup

Codacy Open Source plan is free for all open source projects and Pro plan is 18$ per month for private repositories. Setup is simple as login to https://app.codacy.com, allow access to your GitHub repository and just add a project. After a few minutes Codacy will make Quality evolution and display all of the issues in Issues breakdown panel.

There are few available dashboards where you can: Customize your code analysis, Get feedback on your code, track code quality and check security issues.

Coveralls

Coveralls mission is to offer to its user's well-tested codebase and show which part of the code is not covered with tests. Coveralls will display test coverage percentage like a badge so you can add that badge to your repository. Supported languages by Coveralls are Go, Python, C++, C, Java, Ruby, JavaScript, PHP, Swift, Objective-C, Lua, Elixir. It is used in big companies like Django, Docker, Mozilla, Linkedin, Microsoft, Heroku. 

Pricing and setup

There are four pricing plans:

  • Open Source: free and unlimited for open source repositories.
  • Coveralls Solo: $5 per month for 1 private repository.
  • Coveralls Org: $25 per month for 10 private repositories.
  • Coveralls Pro: $100 per month for unlimited private repositories.

Configuring your Travis CI build to send results to Coveralls always follows the same pattern:

  1. Select which repository to be added to Coveralls.
  2. Configure your build to install the Coveralls library for the programming language you’re using.
  3. Add Coveralls to your test suite.
  4. Create .coveralls.yml or add coveralls to travis.yml.

After setting up, Coveralls will display: 

  • Repository overviews.
  • Line by line coverage. 
  • File coverage reports. 
  • GitHub notices.
  • Repository coverage stats.

Better Code Hub

Better code hub is a quality code tool that will check your code against (10) best software guidelines, and display results within minutes. Supported languages are Java, Python, Go, C#, Ruby, Scala, PHP, JavaScript, TypeScript, Solidity, Shell, Groovy, Objective C. 

Better Code Hub will automatically prioritize action items for you, for different code units e.g classes or methods that should be refactored and helps you to improve your overall score.

Pricing and setup

Free plan for open source and non-commercial use, and  Pro plan $20 per user/month for personal and organizational accounts.

Using Better Code Hub takes zero time. There is no need to configure anything just simply switch it on to run at every Pull Request or Push.

Some of the Repository quality reports that Better Code Hub will produce will be for: 

  • Write short units of code. 
  • Write simple units of code.
  • Write the code once.
  •  Keep unit interface small. 
  • Separate concerns in modules.
  •  Keep architecture components balanced. 
  • Couple architecture components loosely.

Travis and Circle CI 

Those are must-have continuous integration tools. In one of the previous articles, we have talked about them and the pros and cons they have. For more information check: Circle CI vs Travis CI

Looking for more tools that work with GitHub?

There are more awesome code quality and code review tools that can help you with quality, security, code reviews and test coverage. You can find them in GitHub marketplace: https://github.com/marketplace/category/code-quality.

For a good example of how to set up Travis, Codacy, Coveralls, and Better Code Hub CI check this GitHub repository: https://github.com/ZoranPandovski/pycoincap.





MORE ARTICLES

Comparison of Continuous Integration Tools

A review of the features offered by Travis CI and Circle CI

Primitive Data Types in Python 3

Introduction to Python 3 primitive data types

Introduction to AWS Lambda

AWS Lambda: Run code without thinking about servers