fix: eliminate string literal duplications in PlantUML mapping#33
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
fix: eliminate string literal duplications in PlantUML mapping#33sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZZjJgtKOPkSvG45yHzz for python:S1192 rule - AZZjJgtKOPkSvG45yHzy for python:S1192 rule Generated by SonarQube Agent (task: d6a18938-c725-4590-b619-be401fd2d201)
Author
|
|
|
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.




Resolves two SonarQube critical issues by extracting repeated string literals into constants. Defines EXTENSION_EXTENSION_PREFIX and PLANTUML_AS constants to replace 4 and 9 duplicate occurrences respectively, improving code maintainability and reducing the risk of inconsistent string values.
View Project in SonarCloud
Fixed Issues
python:S1192 - Define a constant instead of duplicating this literal 'Extension.extension:' 4 times. • CRITICAL • View issue
Location:
PlantUML/construct_mappings.py:109Why is this an issue?
Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all occurrences.
What changed
Defines the constant EXTENSION_EXTENSION_PREFIX = 'Extension.extension:' to replace the duplicated string literal 'Extension.extension:' that appeared 4 times throughout the code. This constant is then used by other hunks to eliminate the duplication.
python:S1192 - Define a constant instead of duplicating this literal '" as ' 9 times. • CRITICAL • View issue
Location:
PlantUML/construct_mappings.py:313Why is this an issue?
Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all occurrences.
What changed
Defines the constant PLANTUML_AS = '" as ' to replace the duplicated string literal '" as ' that appeared 9 times in the PlantUML generation code. This constant is then used by subsequent hunks to eliminate the duplication.
SonarQube Remediation Agent uses AI. Check for mistakes.