CodeSquad: An insight into code quality

http://getcodesquad.com/

Software development has reached beyond the mere question of, “Does it work?”’ However, the question of “how to improve the code quality and its efficiency?” becomes the primary concern.

The code quality improvement is one of the things that requires well-developed strategy and adhering to it throughout the project’s lifecycle. It’s only a matter of time when it catches you up and causes problems if you leave it unaddressed. That’s why it is much better to manage this problem beforehand.

Let’s understand it using a metaphor: Suppose you construct a house without architecture. How long that house is going to stay intact is difficult to say as a foundation is of major concern, not the interior design. In a similar manner, we must strive for a good quality code so that the code will be able to live on without rotting over the time.

Writing code with desired functionality that compiles well is not enough as there are few concerns beyond functionality such as:

  • Proper naming conventions are followed or not.
  • Indentation is proper or not.
  • Style warnings are taken care of or not.
  • Code Optimization is taken care of or not.
  • Best coding practices are followed or not.
  • Design principles are followed or not.
  • Unit test cases are written or not.
  • The code is readable or not.

Code quality is not an abstract concept that has a value only in the developer’s world, it is a real thing which is missing, can lead to great financial losses over the time.

CodeSquad – A revolutionary product for continuous quality check and enables you to identify missing or problematic attributes of your code.

CodeSquad is an application that provides a qualitative analysis and insight of the projects by displaying the quality metrics of the project in a way that is easily accessible, understandable, and easier to compare with previous metrics. CodeSquad keeps the user informed by highlighting the missing or the problematic parameters.

Features:

1. Code Quality at a glance

CodeSquad dashboard presents project’s current quality at a glance by placing all quality parameters in a single row.

2. A check on technical debt

Use graphs and visualizations to track project quality over time and zoom in on specific time periods for more granular analysis

3. History graphs of project quality stats

Visualise the history of a project and understand precisely what happened in the past till past six months.

4. Notifications

CodeSquad dashboard notifies the user about activities like report upload status, health report by comparing new report’s result with the previous one(if exists) and outdated reports. It raises an alarm if the project hasn’t been through quality check for the past fifteen days.

5. Collaborator permission

CodeSquad provides quality status not only to project’s admin but also to the collaborators of the project.

Type of Quality metrics/reports CodeSquad can monitor?

Before answering this question, let’s first understand,”what are static analysis tools?“.

Static analysis tools:

They are generally used by developers as part of the development and component testing process. Source code acts as an input to the tool and tool itself is executed. It helps the developers to understand the structure of the code, and can also be used to enforce coding standards. A compiler can be considered as a static analysis tool because it builds a symbol table, points out incorrect usage and checks for non-compliance to coding language conventions or syntax.

Advantages of static analysis tools are:

  • Identifies defects in source code.
  • Provides help in understanding code.
  • Helps in analyzing dependencies and structures.
  • Enforces coding standards.
  • Computing metrics such as cyclomatic complexity which provides tester an indication of the amount of testing, nesting, and a number of lines of code.

Examples of the static analysis tools are:

  • Checkstyle: Checkstyle is a blooming tool that help programmers write Java code that adheres to a coding standard. Each rule can raise notifications, warnings, and errors. For example, checkstyle can examine- naming conventions of attributes and methods, the presence of mandatory headers, spaces between some characters, good practices of class construction and multiple complexity measurements among which expressions.
  • Programming Mistake Detector(PMD): PMD is a source code analyzer that detects flaws in source code, like duplicate Code, wasteful String/StringBuffer usage, classes with high cyclomatic complexity measurements, empty blocks or statements and unused local variables, parameters, and private methods.
  • Copy Paste Detector(CPD): CPD finds duplicate code. Copied/pasted code can mean copied/pasted bugs and thus decreases maintainability.
  • FindBugs: FindBugs is an open source tool used to perform static analysis on Java code. Findbugs scans for possible bugs in Java software. FindBugs operates on java bytecode, rather than source code. Each finding is reported as a warning. Warnings are categorised into four ranks: (i) scariest, (ii) scary, (iii) troubling and (iv) of concern.
  • Java Code Coverage(JaCoCo): JaCoCo is an open source toolkit for measuring and reporting java code coverage. JaCoCo offers instructions, line and branch coverage.
  • Lines of Code(LOC): LOC computes the size of a Java source code file by counting the “logical lines of code.”
  • Scalastyle: Scalastyle examines your Scala code and indicates potential problems with it. It is similar to checkstyle in java.
  • Scoverage: Scoverage is a free Apache-licensed code coverage tool for scala that offers statement and branch coverage.
  • Scapegoat: Colloquially known as a code lint tool or linter. Scapegoat works in a similar vein to Java’s FindBugs or checkstyle, or Scala’s Scalastyle.
  • CodeSquad support these programming languages: Scala & Java

Quality Metrics For Java

  • Check Style
  • Programming Mistake Detector(PMD)
  • Copy Paste Detector(CPD)
  • Find Bugs
  • Java Code Coverage(JaCoCo)
  • Lines of Code(LOC)

Quality Metrics For Scala

  • Lines of Code(LOC)
  • Scala Style
  • SCoverage
  • Scapegoat
  • CPD

Why codeSquad?

  • Secure – CodeSquad don’t need any access to your source code to generate the monitoring dashboard, it only needs the reports generated by code analysis tools.
  • Efficient – It can be used in all types of projects structures/frameworks like SBT/Maven etc.
  • CodeSquad is not limited to few software matrices. Any type of report can be parsed and corresponding results can be displayed.
  • User-Friendly: You don’t have to be a technical person like a tester or a developer for monitoring software health. It allows all levels of users (stakeholders like Managers, QAs, BAs etc.) to understand the quality of code.

What makes codeSquad unique?

CodeSquad not only inspects the quality of code but also keeps its users and collaborators informed about the current check on code’s quality and raises alarm if the project hasn’t been through a quality check.  Clients can keep the continuous check on project matrices and can ensure that their money is spent wisely.

Sounds Interesting? Contact us for having this awesome tool and check your code quality: codesquad@knoldus.com

Written by 

Jyoti Sachdeva is a software consultant with more than 6 months of experience. She likes to keep up with the trending technologies. She is familiar with languages such as C,C++,Java,Scala and is currentky working on akka,akka http and scala. Her hobbies include watching tv series and movies, reading novels and dancing.

Leave a Reply

%d bloggers like this: