---
title: "Comments"
type: "code-smell"
slug: "comments"
url: "http://localhost:3000/en/smells/comments.md"
category: "Dispensables"
description: "A method is filled with explanatory comments."
---
# Comments

> A method is filled with explanatory comments.

## Signs and Symptoms

A method is filled with explanatory comments.

## Reasons for the Problem

Comments are usually created with the best of intentions, when the author realizes that his or her code isn’t intuitive or obvious. In such cases, comments are like a deodorant masking the smell of fishy code that could be improved.

> The best comment is a good name for a method or class.

If you feel that a code fragment can’t be understood without comments, try to change the code structure in a way that makes comments unnecessary.

## Payoff

* Code becomes more intuitive and obvious.
## Relations

**Treated by**

- [Extract Variable](/en/extract-variable.md)
- [Extract Method](/en/extract-method.md)
- [Rename Method](/en/rename-method.md)
- [Introduce Assertion](/en/introduce-assertion.md)


## Detected by

- **pmd** `CommentSize` — Comment too large (https://docs.pmd-code.org/latest/pmd_rules_java_documentation.html#commentsize)
