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

Feature Request/Idea: Remove unused imports and methods #9918

Open
bencomp opened this issue Sep 14, 2023 · 2 comments
Open

Feature Request/Idea: Remove unused imports and methods #9918

bencomp opened this issue Sep 14, 2023 · 2 comments
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.

Comments

@bencomp
Copy link
Contributor

bencomp commented Sep 14, 2023

Overview of the Feature Request

Code that is never executed within Dataverse and that is unreachable from outside Dataverse should be removed. Unused imports should also be removed.

What kind of user is the feature intended for?
Developers

What inspired the request?
Many files in the codebase are messy and have low test coverage. But because of the messiness, it is hard to see what should be covered by tests.

This is also part of my all-time quest to improve the codebase, started a long time ago.

What existing behavior do you want changed?
No behaviour should change.

Any brand new behavior do you want to add to Dataverse?
No behaviour needs to be added.

Any open or closed issues related to this feature request?

@pdurbin pdurbin added Type: Suggestion an idea Component: Code Infrastructure formerly "Feature: Code Infrastructure" User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. Feature: None No user-facing feature in particular labels Oct 8, 2023
@bencomp
Copy link
Contributor Author

bencomp commented Nov 2, 2023

I had a big PR to remove all unused imports and (private) methods, but predictably, while other PRs were merged, merge conflicts would occur. So I closed it. My new plan is to make sure that any PR I create has all unused imports removed.

I suppose we could adjust the Checkstyle file to check for this too, so that contributors are made aware by reviewdog that there are unused imports.

@pdurbin
Copy link
Member

pdurbin commented Nov 2, 2023

While we're add it, should we consider switching to wildcard imports? We don't have any guidance against it at https://guides.dataverse.org/en/6.0/developers/coding-style.html

See also https://stackoverflow.com/questions/147454/why-is-using-a-wild-card-with-a-java-import-statement-bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants