Skip to content

fix: reduce PythonScanner fields from 21 to 20#2289

Open
sonarqube-agent[bot] wants to merge 1 commit into
masterfrom
remediate-master-20260528-050226-9b8b7a6a
Open

fix: reduce PythonScanner fields from 21 to 20#2289
sonarqube-agent[bot] wants to merge 1 commit into
masterfrom
remediate-master-20260528-050226-9b8b7a6a

Conversation

@sonarqube-agent
Copy link
Copy Markdown

This PR was automatically created by the Remediation Agent's Scheduled backlog remediation feature.

Removes the unused lock field from the PythonScanner class to comply with the SonarQube MAJOR issue requiring classes to have no more than 20 fields. This refactoring improves code maintainability by reducing class complexity.

View Project in SonarCloud


Fixed Issues

java:S1820 - Refactor this class so it has no more than 20 fields, rather than the 21 it currently has. • MAJORView issue

Location: python-commons/src/main/java/org/sonar/plugins/python/PythonScanner.java:67

Why is this an issue?

A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain, and having a lot of fields is an indication that a class has grown too large.

What changed

Removes the lock field from the PythonScanner class, reducing the total number of fields from 21 to 20. This directly addresses the code smell warning that the class has too many fields (more than the allowed threshold of 20).

--- a/python-commons/src/main/java/org/sonar/plugins/python/PythonScanner.java
+++ b/python-commons/src/main/java/org/sonar/plugins/python/PythonScanner.java
@@ -87,1 +86,0 @@ public class PythonScanner extends Scanner {
-  private final Lock lock;

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZ5pmweAnkbslnV8uoyi for java:S1820 rule

Generated by SonarQube Agent (task: a62fe598-98fe-40e4-87cb-7e0e4766850d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant