Skip to content

Track unused code #65

@karol-majewski

Description

@karol-majewski

Hello and thank you for your work.

I was wondering if you're interested in making Code Checks track how much dead code is introduced by a PR.

The problem

When making changes to a codebase, it's common to leave code that is exported but never used. It was useful once, but it's not anymore. Unless there are good reasons to leave it in the project, it should be deleted and restored from Git history if need be.

Solutions

There are tools capable of spotting such scenarios:

The problem with some of these tools is that they find too many false positives or they don't provide an escape hatch to mark something as not used now, but let's leave it there. For this reason, using them to prune dead code in a precommit/prepush task may be too aggressive.

I believe there is a use case for them though. If a CI check detected the amount of dead code has increased (and presented the Δ), then this information alone is already useful. I'm not sure if the build should fail or not, but merely being presented with such a warning could help keep our codebases cleaner.

Please let me know what you think, and thanks again for your wonderful tool.

Metadata

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