A codebase under active development is a moving target that’s going to change over time.
This makes it challenging to manage technical debt since it’s virtually impossible to manually track the status of planned improvements while keeping an eye on the rest of the code at the same time.
This article introduces the concept of augmented code analysis, a concept that lets you specify your context and intentions in the form of goals. These goals can then be automatically supervised via tooling.
Manage Technical Debt and Classify Hotspots with Goals
We recently enabled our goal-oriented workflow in the SaaS version of CodeScene. This workflow lets you manage technical debt by specifying goals on the identified hotspots. A goal records your decision, and is automatically supervised by the tool as a quality gate in Pull Requests. As such, goals fill an important role by adding what’s otherwise always missing from a code analysis: context.
You plan a goal as a response to any identified code health issues. There are several types of goals:
Planned Refactoring: By specifying a refactoring goal, CodeScene expects you to improve the code. Should the code degrade or – more common – nothing happens, the goal will fail and be reported.
Supervise: Supervise is our way of saying: yes, we might have some code quality issues here and we can live with them – we just don’t want them to get worse. With a Supervise goal you put a quality bar on an existing code. This is by far the most common goal, and it’s particularly useful in legacy codebases where you want to ensure that no more technical debt is taken on in the application code.
Critical Code: The Critical Code goal is used for tracking code where failures have dire consequences. The typical example is security critical code such as authentication and authorization logic. A Critical Code goals behaves like Supervise and can fail a build pipeline when violated.
No Problem: Occasionally, there’s an ongoing initiative to replace some module or decommission it. In that case, you can instruct CodeScene to ignore this hotspot. However, under the hood, the tool continues to watch No Problem hotspots too, and should something dramatic happen to them, then CodeScene will call your attention to it.