Skip to content

Conversation

@iamdanfox
Copy link
Contributor

Before this PR

Recently I've been tasked with deleting codepaths that have been superseded by newer codepaths. Historically, it's been hard to do this because there is no static analysis that repos run regularly to find dead code. There is some functionality in IntelliJ to identify methods which are unused, but this has a couple of key deficiencies:

  • it considers methods that are only used in tests as still used
  • a pair of classes might use methods from each other, causing IntelliJ to think both of them are valuable

After this PR

==COMMIT_MSG==
New plugin: com.palantir.baseline-dead-code
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Feb 22, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

New plugin: com.palantir.baseline-dead-code

Check the box to generate changelog(s)

  • Generate changelog entry

@ash211
Copy link
Contributor

ash211 commented Oct 22, 2023

I gave this a shot on the foundry/magritte repo internally and found a bunch of dead code! 🎆

One future ER is that it'd be nice to be able to add another project in a repo as a live set of classes, in addition to the sls-java-service-distribution project. In my case, I want to apply com.palantir.baseline-dead-code to my magritte-coordinator project, but also have baseline-dead-code/proguard consider the magritte-sdk project live as well. This repo contains both a service, and an SDK for use by plugins, and anything part of the SDK or used transitively from the SDK must not be deleted.

@stale
Copy link

stale bot commented Jun 27, 2025

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Jun 27, 2025
@stale stale bot removed the stale label Jul 8, 2025
@stale
Copy link

stale bot commented Oct 18, 2025

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants