Skip to content

Remove redundant commented-out code to improve code quality #296

Open
@diogomene

Description

After scanning the source code with SonarQube, commented-out code appears as "code smells" in several project files. On closer inspection, some of these comments actually provide useful insights about the behavior of functions and modules. However, most seem irrelevant, cluttering the codebase and reducing its quality.

To ensure the code remains as maintainable as possible, it is essential to review each commented-out section and remove any obsolete or meaningless fragments. SonarQube is particularly useful here, as it highlights instances of commented-out code (among other code smells), making it easier to identify and address these issues. After this initial review, it’s advisable to export the results as a JSON file—available via the SonarQube API—to document findings for future reference by repository maintainers. Lastly, human verification of each flagged comment is crucial; comments that do not add value for context, learning, or detailed explanation of operations should indeed be considered code smells and removed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions