Chapter 9. Maintaining Code Quality
While working on a project, we want to have some kind of tooling or process in place that we can use to see if our code follows certain standards; either our code has no common coding problems or calculates the complexity of the code.
We need these tools to write better code. Better code means it will be easier to maintain, and this lowers the cost of maintaining the code. In a project team, we want to make sure that the code follows the same standards defined by the project team. A company could define a set of standards that developers need to follow, as a condition for the project to be started.
There are tools already available for Java and Groovy projects to analyze and check source code, such as Checkstyle, JDepend, PMD, FindBugs, CodeNarc, and Sonar. Gradle has plugins for each of these tools. In this chapter, we will take a look at the plugins and learn how to use them in our projects.