Skip to content

[rewrite] Add RemoveUnusedPrivateMethods#3400

Closed
Pankraz76 wants to merge 1 commit intoSonarSource:masterfrom
Pankraz76:pr-pr-method-fix
Closed

[rewrite] Add RemoveUnusedPrivateMethods#3400
Pankraz76 wants to merge 1 commit intoSonarSource:masterfrom
Pankraz76:pr-pr-method-fix

Conversation

@Pankraz76
Copy link
Copy Markdown

@Pankraz76 Pankraz76 commented Nov 9, 2025

Signed-off-by: Vincent Potucek <vpotucek@me.com>
@Pankraz76 Pankraz76 marked this pull request as ready for review November 9, 2025 13:43
import org.sonar.api.ExtensionPoint;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.ce.common.scanner.ScannerReportReader;
import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used in fact with the link in the javadoc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry yes, this is an onboing bug im sorry. Will undo or suppress this file.

@matteo-mara-sonarsource
Copy link
Copy Markdown
Contributor

Thanks for your contribution @Pankraz76!
This pull request cannot be takes as is for a few reasons.

Because we are not going to introduce the rewrite plugin in the codebase, but mainly because there were a few refactoring done here by rewrite that are quite wrong.
Specially when dealing with the DTO Classes, some methods are considered unused, but they are actually used by MyBatis when mapping the database entries in our Java classes.

The plugin did a good job in finding the unused methods, I think they match quite well with what SonarQube spot that you can see here.

Those maintainability issues are still open at the moment because our usual approach is to fix them when refactoring or adding more stuff to the classes affected.
And those test classes have probably not been touched since a long time.

/**
* This is the getter used by MyBatis mapper.
*/
private String getKee() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods are in fact used by MyBatis, the mapping will fail if they are removed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will apply suppression so we can fix this together.

@Pankraz76
Copy link
Copy Markdown
Author

@matteo-mara-sonarsource build seems broken locally and on ci:

Could not find com.sonarsource.sonarcloud:compliance-reports:0.0.1.2263.

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.

2 participants