<img src="https://secure.leadforensics.com/794635.png" style="display:none;">
Skip to content
Published at September 08, 2017
Product

Early Warnings for Future Maintenance Problems

CodeScene's early warning feature helps detect future maintenance problems before they become problems.

A dashboard that shows how CodeScene detects early warnings in your codebase.

A codebase under active development evolves at a rapid pace, and as soon as the organization scales beyond 10-12 people it’s virtually impossible for a single individual to maintain a holistic picture of the system. 

The roots of future maintenance problems are often introduced in change bursts, perhaps by shoehorning a new feature into an existing design, and from there they only grow worse over time. Wouldn’t it be great if you could get an early warning when that happens so that you can take appropriate counter measures and save your code from decay?

 

What’s an Early Warning?

The CodeScene tool offers the ability to detect potential maintenance problems and early warnings in your codebase. The earlier you react to those findings, the better, so let’s look at a few examples.

The following figure shows an example on three different warnings auto-detected by CodeScene in Google's TensorFlow codebase. TensorFlow is a library for machine learning, and the warnings are highlighted using yellow tiles:

CodeScene detects early warnings in your codebase.CodeScene detects early warnings in your codebase.

 

These early warnings point your attention to different aspects of the system:

  • Detects Code before it becomes a Hotspot: This warning highlights code that isn’t a hotspot yet, but climbs rapidly on the hotspot ranking (check out Predict Maintenance Problems In Large Codebases for an introduction to hotspots). You use this information as a driver to refactor those Hotspots into more cohesive units, if appropriate.
  • Identifies Steep Increases In Complexity: Since CodeScene knows how your code typically evolves, the tool can detect parts of the code that suddenly increases in complexity as shown in the next figure. This doesn’t mean it’s a problem, rather the warning is CodeScene’s way of drawing your attention to an area of the code. Use this information to focus code reviews and additional testing.

Early warnings are delivered for code that accumulate complexity rapidly.Early warnings are delivered for code that accumulate complexity rapidly.

  • Predict Delivery Risk: CodeScene calculates a risk profile for your codebase, which is based on how the system has evolved and what a typical change looks like. That is, the algorithm focuses more at how a commit looks than the changed code itself and combines its technical metrics with social data such as developer experience. This is information that you use to prioritize code reviews and to reason about delivery risks of individual features.

The detailed view of high risk commits-2The detailed view of high risk commits

 

Context Matters

The advantage of social code analyses – like these early warnings – is that they take your context into account. This is important because different organizations have different quality goals; In some codebases large, monolithic files are the norm, while others prefer a more modular design with small and cohesive units.

CodeScene solves that by making the warnings relative to the rest of your code, which means that false positives are kept at a minimum and the presented results are directly relevant in your context.

Finally, there’s the option of integrating the early warning detection into your continuous integration pipeline as demonstrated.

CodeScene is free for open source, so give it a try.

Adam Tornhill

Adam Tornhill

Adam Tornhill is a programmer who combines degrees in engineering and psychology. He’s the founder and CTO of CodeScene where he designs tools for code analysis. Adam is also a recognized international speaker and the author of multiple technical books, including the best selling Your Code as a Crime Scene and Software Design X-Rays. Adam’s other interests include modern history, music, retro computing, and martial arts.

Elements Image

Subscribe to our newsletter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Semper neque enim rhoncus vestibulum at maecenas. Ut sociis dignissim.

Latest Articles

AI Coding Assistants: Introducing CodeScene AI Generated Code Refactoring

AI Coding Assistants: Introducing CodeScene AI Generated Code Refactoring

AI Coding Assistants: Let's introduce you to AI generated code refactoring. Read more and join the Beta testing program.

Change coupling: visualize the cost of change

Change coupling: visualize the cost of change

Code can be hard to understand due to excess accidental complexity. Or, it can look simple, yet its behavior is anything but due to complex...

CodeScene's IDE Extension brings CodeHealth™ Analysis directly into your editor

CodeScene's IDE Extension brings CodeHealth™ Analysis directly into your...

We've just launched an IDE Extension for VS Code, helping developers tackle code complexity within the editor. Read more and try it out!