7.4. Summary

Static analysis tools can be an important tool for improving the quality of your code. They can help you identify hot spots in the code that need more testing or refactoring, or help an architect determine strategic changes that need to be made across the entire product.

The biggest cost of such tools comes in the form of the additional time and training needed to bring the team up to speed on what the reports mean and how issues they bring to light should be dealt with. If the wrong metrics are published or too much information is added to the build process by analysis tools, the information will cause more problems than it solves. It will lead to time wasted on chasing the wrong things, or writing code just to change the results of the metrics being measured. Take every metric with a grain of salt, and apply some real effort to making sure that you get the right ones to the right people.

Any static analysis tools should be integrated into your process as early as feasible so that problems they uncover can be fixed a small number at a time, and new problems will be obvious and not get lost in the noise of too many errors going unaddressed. Pick carefully which metrics you want to report to the whole team as part of a CI build, and make sure that the ones you choose are relevant to everyone and can be addressed by every member of the team.

Get Code Leader: Using People, Tools, and Processes to Build Successful Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.