The Code Review Journalreview desk · diff view

Review bench › Code Smells

Code Smells Aren't Subjective: How to Make Your Review Objective

Checklist entry · recorded 2026-10-13

1 Overview

Code smells are patterns in source code that suggest a deeper problem with design, readability, or maintainability. The phrase itself often triggers disagreement, because two engineers can look at the same function and reach opposite conclusions about whether it is fine or whether it needs work. One sees a long method as a natural expression of a complex business rule. The other sees it as a future maintenance hazard. When a review turns into a debate about personal preference, the change stalls, the author feels judged, and the team learns nothing reusable.

The problem is not that smells are inherently subjective. The problem is that reviewers usually describe them subjectively. Saying a function feels too long, or that a class seems to do too much, invites an argument about taste. Saying that a function has twelve branches, that three of them duplicate logic already present elsewhere, and that a new caller would need to understand all twelve to use it safely is a different kind of statement. It points at observable structure and connects that structure to a consequence the team cares about.

This article is about turning smell detection into an objective, repeatable part of code review. The goal is not to eliminate judgment. Judgment is what decides whether a smell matters in context. The goal is to give that judgment something concrete to stand on, so reviews become faster, fairer, and more useful to the people writing the code.

2 Why the usual advice misses the point

Most guidance about code smells falls into one of two traps. The first is a catalogue approach: here are twenty named smells, memorize them, and flag them when you see them. This produces reviewers who can recite terminology but cannot explain why a particular instance is worth the author's time. The second trap is the opposite: smells are just heuristics, everything is context-dependent, so do not worry about them. This produces reviewers who miss genuine structural problems because they have no shared vocabulary for raising them.

Both approaches fail for the same reason. They treat the smell as the unit of discussion rather than the evidence and the consequence. A smell is only a signal. What matters in a review is whether the signal points to something the team will actually pay for later: harder onboarding, riskier changes, slower tests, duplicated fixes, or logic that is difficult to verify. Without that link, a comment about a smell reads as an aesthetic complaint, and aesthetic complaints are easy to dismiss.

There is also a social dimension. Reviews are conversations between people with different experience levels and different mental models. Vague criticism lands as a verdict on the author rather than on the code. Objective criticism lands as a shared observation about the artifact. The difference is not softness or politeness. It is whether the comment gives the author something they can evaluate, agree with, or push back on using evidence rather than status.

3 The core idea in practice

The core idea is to convert every smell comment into three parts: the observable pattern, the concrete consequence, and the smallest change that would address it. The observable pattern is something anyone can verify by looking at the code, such as a function with many parameters, a block of near-duplicate logic, a class that reaches into another module's internals, or a conditional chain that grows with every new case. The consequence is what that pattern costs the team, stated in terms of change, testing, or comprehension. The suggested change is a direction, not a mandate.

For example, instead of writing that a method is too long, a reviewer might note that the method mixes input validation, business rules, and persistence, so a change to any one of those concerns requires reading and retesting all three. That is observable and it names a cost. The suggestion might be to extract the validation step so it can be tested on its own. The author can then decide whether that extraction is worth doing now, later, or never, and can explain why.

This framing also makes severity easier to agree on. Some smells are worth fixing before merge because they will make the next change harder. Others are worth recording as a follow-up. Others are worth ignoring because the code is stable, isolated, or scheduled for replacement. The point is that the team makes that call using shared criteria rather than whoever feels most strongly in the moment. Objectivity here means traceability, not the absence of opinion.

4 A repeatable review process

A repeatable process starts before the review begins. The team agrees on a short list of structural signals it cares about, ideally fewer than ten, chosen because they have caused real pain in the past. These might include duplicated business rules, functions with too many responsibilities, hidden dependencies between modules, and unclear naming around domain concepts. Keeping the list short matters, because a long list becomes noise and reviewers stop applying it consistently.

During review, the reviewer reads the change twice with different questions in mind. The first pass asks whether the change does what it claims and whether it is correct. The second pass asks whether the structure will make the next change harder. Smell observations belong in the second pass, and they should be written using the pattern-consequence-suggestion format. Reviewers should also distinguish between blocking concerns and optional improvements, and say which one they mean. Ambiguity about severity is one of the most common sources of friction in review threads.

After review, the team should occasionally revisit its list. If a signal never produces useful comments, drop it. If a new kind of problem keeps appearing, add it. Over time the list becomes a living description of the codebase's actual weak points rather than a generic checklist. This is what makes the process objective: the criteria are shared, written down, and revised based on experience, not reinvented by each reviewer on each pull request.

5 Common mistakes reviewers make

The first mistake is flagging a smell without explaining the cost. A comment that says a class is too large tells the author nothing they can act on, and it invites a debate about thresholds. A comment that says the class now has three reasons to change, and names them, gives the author something concrete to consider. The second mistake is treating every smell as a blocker. Not every structural imperfection needs to be resolved before merge. Reviewers who block on style-adjacent concerns train authors to avoid asking for review, which is a much worse outcome than a slightly imperfect method.

The third mistake is inconsistency. If one author's long function is accepted without comment and another author's similar function is challenged, the team learns that review outcomes depend on who is reviewing rather than on the code. That erodes trust quickly. Consistency does not require identical comments; it requires that the same signal triggers the same kind of question regardless of who wrote the change.

A fourth, subtler mistake is reviewing the author instead of the change. Phrases like you always do this, or this is just how you write, shift the conversation from the artifact to the person. Even when the observation is accurate, it makes the feedback harder to accept and harder to act on. Keep the comment attached to the code in front of you, and let patterns across changes be a separate, private conversation if they need to happen at all.

6 Tooling that helps (and where it fails)

Static analysis and linting tools are genuinely useful for the mechanical end of smell detection. They can flag duplicated blocks, overly complex functions by measurable criteria, unused code, and inconsistent naming conventions. Because they apply the same rule to every change, they remove a large class of inconsistency from human review. When these tools run automatically and report findings in the same place as the review, reviewers can spend their attention on design questions instead of counting lines or spotting copy-paste.

Their limits matter just as much. Tools measure structure, not intent. A long function that expresses a single, well-understood domain rule may be perfectly clear, while a short function with a misleading name can be far more damaging. Tools also cannot tell whether a smell is worth fixing now, later, or never. That judgment depends on the roadmap, the stability of the code, and the team's tolerance for change in that area. Treating tool output as a verdict rather than a prompt is a common way to generate resentment toward the tooling itself.

The practical approach is to let tools handle what they are good at and reserve human review for what they cannot see. Configure the tooling to be quiet enough that its findings are taken seriously, and route its output into the review conversation rather than around it. The tool supplies evidence; the team supplies context and priority. Neither replaces the other, and a review process that confuses the two will either drown in noise or miss the problems that matter most.

7 Frequently asked questions

Are code smells ever truly objective? The underlying patterns can be observed and measured, so they are objective in the sense that two people looking carefully can agree on what is present. Whether a given pattern is a problem depends on context, which is a judgment. The useful move is to separate the observation from the judgment and make both explicit. That way disagreement happens at the right level, about priorities and trade-offs, rather than about whether the pattern exists at all.

How many smells should a team track? Fewer than ten is a reasonable starting point. The list should be short enough that reviewers remember it without consulting a document, and specific enough that it maps to problems the team has actually experienced. A long catalogue dilutes attention and makes consistent application unlikely.

What if the author disagrees? Disagreement is useful when it is about consequences. If the author can explain why the structure is appropriate for this context, that is a legitimate outcome and the review should move on. If the disagreement is about whether the pattern exists, the code itself can settle it. What should not happen is a debate about who has better taste, because that debate has no resolution and no benefit.

Should smell comments block a merge? Only when the consequence is serious enough that merging would create a problem the team is unwilling to accept, such as a duplicated rule that will now need to be fixed in two places. Otherwise, record the observation as a follow-up and let the change proceed. The goal is a healthier codebase over time, not a perfect diff.