1 Overview
Code smells are surface indicators of deeper problems in how a team writes, reviews, and maintains software. A long method, a god class, or duplicated logic might seem like isolated issues to fix in a single pull request. But when the same smells keep appearing across different authors and modules, they point to systemic gaps in process, communication, or tooling. This article argues that effective code review should treat smells as diagnostic clues, not just as defects to be patched.
In many teams, review feedback focuses on the immediate code change: rename this variable, extract that function, add a test. While these fixes improve the current commit, they rarely prevent the next occurrence. The alternative is to use the review as a moment to ask why the smell arose. Was the author missing context about existing utilities? Did time pressure discourage refactoring? Is there no shared definition of done? Answering these questions leads to process changes that reduce future smells.
This approach does not replace technical judgment. Reviewers still need to identify concrete issues and suggest improvements. But by shifting some attention to root causes, teams can move from whack-a-mole fixes to durable improvements. The goal is not to eliminate all smells—some are acceptable trade-offs—but to distinguish between one-off compromises and recurring patterns that warrant a process response.
2 Why the usual advice misses the point
Most code review guidance focuses on the mechanics: keep changes small, review promptly, be kind, use checklists. These are valuable, but they often treat smells as purely technical problems. The implicit assumption is that if reviewers catch and correct enough smells, code quality will improve. In practice, this leads to review comments that address symptoms while the underlying causes persist. For example, a reviewer might repeatedly ask for more tests, but if the team lacks a clear testing strategy or time for test writing, the same request will recur.
Another common pitfall is relying on automated tools to flag smells. Linters and static analyzers are excellent at detecting known patterns, but they cannot understand context. They may flag a long function that is actually a straightforward sequence of steps, while missing a design flaw that spans multiple files. When teams treat tool output as the primary review criterion, they risk optimizing for tool compliance rather than meaningful improvement. Moreover, tool warnings can create noise that desensitizes reviewers to real issues.
The usual advice also tends to be author-centric: it tells reviewers how to give feedback and authors how to receive it. But smells often arise from environmental factors—unclear requirements, tight deadlines, lack of domain knowledge, or inadequate onboarding. A review process that ignores these factors will keep encountering the same smells. To break the cycle, teams need to look beyond the diff and consider the conditions that produced it.
3 The core idea in practice
The core idea is simple: when you spot a recurring smell, pause and ask what process change could prevent it. This does not mean turning every review into a retrospective. Instead, it means adding a lightweight diagnostic step. For instance, if you notice that multiple pull requests in a sprint have insufficient error handling, you might raise the issue in a team meeting and agree on a shared pattern or helper function. The next review can then reference that agreement, and the smell becomes less likely.
Implementing this requires a shift in how review comments are framed. Instead of only saying “extract this method,” a reviewer might say “this method is long; is there a shared utility we could use, or should we pair on refactoring it?” This opens a conversation about root causes. It also distributes ownership: the author is not solely responsible for fixing a systemic issue. Over time, the team builds a catalog of common smells and their corresponding process fixes, which can be documented in a lightweight guide.
Crucially, this practice must be balanced with pragmatism. Not every smell warrants a process change. Some are one-off trade-offs made under deadline pressure. The skill lies in recognizing patterns: if the same smell appears in three different reviews within a month, it is likely systemic. If it appears once, a simple fix may suffice. Teams can use review metrics—such as the frequency of certain comment types—to identify patterns without inventing precise statistics. The goal is to make process improvement a natural part of review, not a separate bureaucratic exercise.
4 A repeatable review process
A repeatable process for process-oriented review has four steps: detect, diagnose, decide, and document. Detection happens during normal review: reviewers note smells as they would any other issue. Diagnosis is a brief team conversation—often asynchronous—about why the smell occurred. Was it a knowledge gap, a missing abstraction, a tooling limitation, or a time constraint? The diagnosis should be blameless and focused on systems, not individuals.
Decision follows diagnosis: the team chooses whether to address the root cause now, later, or not at all. Not every diagnosis leads to action; some issues are acceptable given current priorities. If the team decides to act, the action should be concrete and owned. For example, “We will add a shared validation utility and update the style guide by next sprint.” This turns a vague concern into a trackable improvement. If the team decides not to act, it is still valuable to acknowledge the trade-off explicitly, so the smell is not repeatedly flagged without resolution.
Documentation closes the loop. The team records the smell, the diagnosis, and the decision in a shared place—perhaps a wiki page or a pinned message. This prevents re-litigating the same issue and helps new members understand why certain patterns are accepted or discouraged. Over time, this documentation becomes a living guide to the team's engineering standards. The process is lightweight: it can happen in a weekly review retro or a dedicated channel. The key is consistency, not ceremony.
5 Common mistakes reviewers make
The first mistake is treating every smell as a defect that must be fixed in the current change. This leads to scope creep and frustration, especially when the smell is a symptom of a larger issue. Reviewers should distinguish between blocking issues and opportunities for improvement. A long method might be acceptable if it is clear and well-tested; forcing a refactor in a small bug-fix pull request can introduce risk. Instead, note the smell and suggest a follow-up task if it is part of a pattern.
The second mistake is giving feedback that is purely technical without exploring context. For example, commenting “this needs more tests” without asking whether the author had time or knowledge to write them. A better approach is to ask, “What made testing difficult here?” This invites a conversation about root causes. Reviewers should also avoid assuming that their preferred solution is the only one; different contexts may call for different trade-offs.
The third mistake is ignoring the author's constraints. Deadlines, unclear requirements, and legacy code can all contribute to smells. A reviewer who does not consider these factors may come across as out of touch. Instead, acknowledge the constraint and focus on what can be improved within it. For instance, “Given the deadline, let's at least add a TODO and a ticket for refactoring.” This maintains quality without demanding unrealistic changes. Finally, reviewers should avoid using smells as a way to assert superiority; the goal is team improvement, not individual criticism.
6 Tooling that helps (and where it fails)
Tooling can support process-oriented review by surfacing patterns and trends. Static analysis tools can flag common smells, and code review platforms can track comment categories over time. For example, if a team tags review comments with labels like “testing,” “naming,” or “duplication,” they can later analyze which labels appear most frequently. This data can inform process improvements without relying on invented statistics. Some platforms also allow custom checks that enforce team-specific rules, such as requiring a linked issue for certain changes.
However, tooling fails when it is treated as a substitute for human judgment. Automated checks cannot understand context, so they may flag false positives or miss nuanced issues. They also cannot diagnose root causes or facilitate team conversations. Over-reliance on tooling can lead to a compliance mindset, where the goal becomes satisfying the tool rather than improving the code. Reviewers may ignore smells that the tool does not catch, or they may spend excessive time on tool warnings that are not relevant.
Another limitation is that tooling often focuses on code-level metrics rather than process metrics. A tool might report cyclomatic complexity but not why complexity is increasing. Teams should use tooling to augment, not replace, their diagnostic conversations. For instance, a dashboard showing the number of review comments per category can prompt a discussion, but the discussion itself must happen among people. Tooling should be configured to reduce noise and highlight actionable patterns, not to generate more work. The best tools are those that integrate smoothly into existing workflows and provide just enough signal to inform process decisions.
7 Frequently asked questions
Q: Does this mean we should stop fixing code smells in reviews? A: No. Fixing smells is still valuable, especially when they are clear defects or risks. The point is to also consider whether a smell is part of a pattern that warrants a process change. If it is a one-off, fix it and move on. If it recurs, investigate the root cause.
Q: How do we avoid turning every review into a lengthy discussion? A: Keep the diagnostic step lightweight. Not every smell needs a deep dive. Use a simple rule: if the same smell appears in multiple reviews within a short period, raise it for discussion. Otherwise, handle it as a normal review comment. The process should be proportional to the impact.
Q: What if the team disagrees on whether a smell is a problem? A: That is a sign that the team lacks shared standards. Use the disagreement as an opportunity to define what “good” looks like for that area. Document the decision and move on. Over time, these decisions form a team-specific style guide that reduces future debates.
Q: How do we measure success? A: Look for a reduction in recurring review comments about the same issues. You might also track whether process changes are implemented and whether they lead to fewer smells. Avoid inventing precise metrics; qualitative observation and team feedback are often sufficient. The ultimate success is a team that learns from its reviews and continuously improves its process.