Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants