fix: reduce PythonScanner fields from 21 to 20#2289
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
fix: reduce PythonScanner fields from 21 to 20#2289sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZ5pmweAnkbslnV8uoyi for java:S1820 rule Generated by SonarQube Agent (task: a62fe598-98fe-40e4-87cb-7e0e4766850d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the unused
lockfield 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. • MAJOR • View issue
Location:
python-commons/src/main/java/org/sonar/plugins/python/PythonScanner.java:67Why 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
lockfield from thePythonScannerclass, 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).SonarQube Remediation Agent uses AI. Check for mistakes.