The Code Review Journalreview desk · diff view

Review bench › Code Smells

Code Smells Are Not Subjective: How to Make Your Review Objective

Checklist entry · recorded 2026-10-13

1 Overview

Code smells are often dismissed as matters of personal taste, leading to inconsistent reviews and unresolved debates. This article argues that many smells can be made objective by defining them in terms of measurable properties and team-agreed thresholds. By shifting from subjective opinion to shared criteria, teams can reduce friction and improve code quality. The shift does not require exotic techniques or heavyweight process. It requires a willingness to name the property you care about, decide what range is acceptable for your codebase, and then use that shared definition consistently in review conversations.

The core idea is to treat smells as symptoms of deeper problems, not as absolute violations. For example, a long method is not inherently bad, but it often correlates with low cohesion and high complexity. By quantifying such properties, like method length, cyclomatic complexity, or duplication percentage, teams can set thresholds that trigger discussion rather than dictate outcomes. This approach respects context while providing a common language for reviewers. A threshold is not a law of nature; it is a team decision that can be revisited whenever the evidence suggests it should change.

We will explore why typical advice like use your judgment fails, how to operationalize smell detection, and a repeatable process for reviews. We will also cover common pitfalls and the role of tooling. The goal is not to eliminate judgment but to ground it in observable, team-specific standards that evolve with the codebase. When reviewers share a vocabulary of measurable properties, disagreements become narrower and more productive. Instead of arguing about taste, the team can ask whether a specific number reflects a real risk in this particular context.

2 Why the usual advice misses the point

Common guidance on code smells often boils down to you will know it when you see it or follow your instincts. Such advice is unhelpful because it assumes a universal standard that does not exist. What one developer considers a smell, another may see as a pragmatic choice. Without concrete criteria, reviews become battlegrounds for personal preferences, and important issues get lost in subjective debates. The result is that the same code may pass one reviewer and fail another, which erodes trust in the review process itself.

Moreover, the usual advice ignores the role of context. A long method in a throwaway script is different from one in a core library. A duplicated block might be acceptable in tests but problematic in production code. By failing to account for context, generic advice leads to either over-flagging or under-flagging. It also puts undue pressure on reviewers to be arbiters of taste rather than facilitators of improvement. Reviewers who are forced to defend vague preferences often retreat to silence, letting real maintainability risks pass unchallenged.

Another flaw is the assumption that smells are always negative. In reality, they are heuristics, signals that something might be wrong. Treating them as definitive problems can lead to unnecessary refactoring and wasted effort. The better approach is to use smells as conversation starters, backed by data and team agreements. This transforms reviews from subjective critiques into collaborative problem-solving sessions. It also gives authors a fair chance to explain why a particular structure exists, which is especially important when performance, compatibility, or delivery constraints shape the code.

3 The core idea in practice

To make smell detection objective, start by selecting a small set of smells relevant to your team. For each, define one or more measurable properties. For instance, long method could be measured by lines of code or cyclomatic complexity. Duplication could be measured by the number of identical or near-identical blocks. Then, agree on thresholds that trigger a review comment. These thresholds should be based on your codebase's norms and adjusted over time. Starting small matters because a long list of rules is harder to remember and easier to ignore than a handful of well-understood ones.

Next, integrate these definitions into your review process. When a threshold is exceeded, the reviewer raises it as a point for discussion, not as a mandate. The author can then provide context or suggest alternatives. This shifts the focus from this is wrong to this exceeds our agreed threshold, let us discuss. It also encourages authors to self-check before submitting, reducing review friction. Over time, authors internalize the thresholds and begin to make better structural choices before the code ever reaches review.

Finally, document these definitions and thresholds in a shared guide. Make it a living document that evolves as the team learns. By doing so, you create a common language that new members can quickly adopt. This practice not only makes reviews more objective but also fosters a culture of continuous improvement and shared ownership of code quality. The guide should include brief examples of what a threshold breach looks like and what a justified exception looks like, so that the team shares not just numbers but also a sense of proportion.

4 A repeatable review process

A repeatable process begins with preparation. Before reviewing, ensure you understand the change's purpose and context. Then, apply your team's smell definitions systematically. For each file, check for the agreed-upon smells and note any that exceed thresholds. Use a checklist to maintain consistency across reviewers. Preparation also means knowing which parts of the change are most critical, so that limited review attention goes where it matters most rather than being spread evenly across every line.

During the review, frame each smell as a question or observation. For example, this method has a cyclomatic complexity of 15, which is above our threshold of 10, could it be simplified? This invites dialogue rather than defensiveness. If the author justifies the complexity, the reviewer can accept it or suggest a follow-up. The key is to separate the signal, the smell, from the decision, whether to act. Separating these two steps keeps the conversation evidence-based and reduces the chance that a comment feels like a personal attack.

After the review, track which smells are frequently flagged and whether they lead to changes. This data can inform adjustments to thresholds or additional training. Over time, the process becomes more efficient as the team internalizes the criteria. Remember, the goal is not to eliminate all smells but to make deliberate choices about which to address. A repeatable process ensures that reviews are fair, focused, and productive. It also creates a feedback loop in which the team's standards are tested against real outcomes rather than being treated as fixed rules handed down from above.

5 Common mistakes reviewers make

One common mistake is treating smells as absolute violations. Reviewers may insist on refactoring even when the author has valid reasons for the current design. This leads to unnecessary churn and resentment. Instead, use smells as prompts for discussion, not as mandates. Another mistake is ignoring context. A smell in a prototype may not warrant the same attention as one in critical code. Failing to consider the broader picture can result in misplaced priorities. A reviewer who blocks a small change over a minor threshold breach while missing a serious correctness issue has inverted the purpose of review.

A third mistake is relying solely on automated tools. While tools can detect many smells, they lack human judgment. They may flag false positives or miss context-specific issues. Reviewers should use tool output as a starting point, not as the final word. Additionally, some reviewers apply their personal thresholds inconsistently, leading to confusion. This undermines the goal of objectivity. Consistency is not about being rigid; it is about giving authors a predictable sense of what will be raised and why, so they can respond with evidence rather than guesswork.

Finally, reviewers sometimes focus on smells at the expense of more critical issues like security or correctness. It is essential to prioritize. Smells are indicators of maintainability, but they are not the only concern. By avoiding these mistakes, reviewers can make the process more effective and collaborative. A useful habit is to ask whether a comment would change the behavior, safety, or long-term cost of the code. If the answer is no, the comment may be better framed as an optional suggestion than as a required change.

6 Tooling that helps (and where it fails)

Static analysis tools can automatically detect many code smells, such as long methods, large classes, and duplication. They provide objective metrics that can be used to enforce team thresholds. Integrating these tools into your continuous integration pipeline ensures that smells are caught early, before review. This reduces the burden on reviewers and provides a consistent baseline. When the same measurement is applied to every change, authors can see the numbers themselves and decide whether to act before a human reviewer ever looks at the code.

However, tooling has limitations. Tools cannot understand intent or context. They may flag code that is intentionally complex for performance reasons or flag test code that mirrors production patterns. They also may not support your team's specific smell definitions. Therefore, tool output should be used as a guide, not a gate. Reviewers must interpret the results and decide whether action is needed. A tool that reports a number is not making a judgment; it is providing an input to a human conversation about trade-offs.

Moreover, over-reliance on tools can lead to a false sense of security. Passing all checks does not guarantee good design. Tools should complement, not replace, human judgment. The best approach is to use tools to handle mechanical detection, freeing reviewers to focus on higher-level concerns. This hybrid approach combines objectivity with the nuance that only humans can provide. The most effective teams treat tool output as a shared starting point, then apply their documented thresholds and context to decide what actually deserves attention.

7 Frequently asked questions

What if my team disagrees on thresholds? Start with a discussion to understand each other's perspectives. Begin with conservative thresholds and adjust based on experience. The goal is consensus, not unanimity. Over time, thresholds can be refined as the team learns what works. It also helps to record the reasoning behind a threshold, so that future disagreements can be resolved by revisiting the original trade-off rather than relitigating personal preferences from scratch.

How do we handle legacy code with many smells? Focus on new code and changes. For legacy code, use the boy scout rule, leave it a little better than you found it. Avoid large-scale refactoring unless necessary. Prioritize smells that impact maintainability the most. A practical approach is to set a separate, more permissive threshold for legacy areas and a stricter one for new code, so that improvement is encouraged without blocking progress on unrelated work.

Can smells be completely objective? Not entirely, but you can make them more objective by defining measurable properties and team agreements. Subjectivity decreases as shared understanding increases. The process is iterative. Even a partially objective standard is more useful than a purely intuitive one, because it gives the team something concrete to discuss, test, and revise as the codebase evolves.

What if a smell is flagged but the author disagrees? Encourage a discussion. The author may have context that justifies the smell. If the team agrees, update the thresholds or document exceptions. The goal is continuous improvement, not rigid adherence. Documenting exceptions is valuable because it turns a one-off disagreement into a shared precedent that future reviewers can reference.

How often should we review our smell definitions? Regularly, perhaps quarterly. As the codebase evolves, so should your criteria. Solicit feedback from the team and adjust accordingly. This keeps the process relevant and effective. A scheduled review also prevents thresholds from becoming stale artifacts that no longer reflect the team's actual priorities or the realities of the system.