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

Remove dead codes. #16668

Open
czp13 opened this issue Apr 22, 2023 · 1 comment
Open

Remove dead codes. #16668

czp13 opened this issue Apr 22, 2023 · 1 comment
Assignees

Comments

@czp13
Copy link
Contributor

czp13 commented Apr 22, 2023

Description of the bug

I believe there are some opportunities to remove unused codes.

Similar to this PR (removed dead codes which I have observed accidentally)

This dead code was blocking to update to the newest 4.9.0 selenium (and to any new selenium versions after this).
Tests can be a low-hanging fruit, but maybe there are some other utils or other classes which are easier to remove dead code.

Short analysis executed shown 562 opportunities:
image

Probably not all of them can be removed as some of them are part of abstract classes which used elsewhere, but these methods for example could be removed:


GwtEventHandlerTest.assertPolymerMethods

JsonUtilsTest
.createNumberStreamForNull()
.createObjectStreamForNull()
.createStreamForNull()

And so on...

Expected behavior

The repository could contain fewer unused code lines, which makes:

  • dependency addition, removal, bumping,
  • refactoring, changes also easier,
  • and just to overview understand the logic, code base better as code is simplified a bit.
  • potentially builds/compilation time can be faster if we remove a lot of dead codes, although by not much probably :D

Minimal reproducible example

In IntelliJ:
Analyze | Run Inspection by Name... | Unused declaration.
(Potentially worth to add Test regexp or Util regexp, as there will be more false positives otherwise)

Versions

  • Vaadin / Flow version: latest
@czp13 czp13 changed the title Remove deadcodes . Remove dead codes. Apr 22, 2023
@czp13 czp13 assigned caalador and czp13 and unassigned caalador and czp13 Apr 22, 2023
@czp13
Copy link
Contributor Author

czp13 commented Apr 25, 2023

Only private methods, and more investigation is needed before removing methods.

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

No branches or pull requests

3 participants