Skip to content

Conversation

@romainbrenguier
Copy link
Contributor

@romainbrenguier romainbrenguier commented Nov 21, 2025

Centralize Sonar property names in ScanPropertyNames

Summary

This PR refactors the codebase to centralize all SonarQube property name string constants in a single ScanPropertyNames class, improving code maintainability and reducing duplication.
This is in preparation for a broader clean-up of SonarPropertyComputer.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Centralize Sonar property names in ScanPropertyNames SCANGRADLE-324 Centralize Sonar property names in ScanPropertyNames Nov 21, 2025
@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Nov 21, 2025

SCANGRADLE-324

romainbrenguier and others added 8 commits November 24, 2025 10:52
Move all Sonar property name string constants from SonarPropertyComputer,
SonarUtils, and AndroidUtils to ScanProperties for better maintainability.

Changes:
- Add all property name constants to ScanProperties with appropriate comments
- Organize constants by category (general, project structure, sources, Java, Groovy, Kotlin, test reports, coverage, Android)
- Mark backward compatibility properties as @deprecated
- Update all references to use the centralized constants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Rename the class to better reflect its purpose as a container for
property name constants rather than actual properties.

Changes:
- Rename ScanProperties class to ScanPropertyNames
- Update all references throughout the codebase
- Update class constructor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Replace string literals with centralized constants for library properties
in SonarTask class.

Changes:
- Add deprecated LIBRARIES constant to ScanPropertyNames
- Import and use JAVA_LIBRARIES and LIBRARIES constants in SonarTask
- Improve code formatting for property key assignments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Replace remaining string literals with centralized constants for test
library and binaries properties.

Changes:
- Import JAVA_BINARIES and JAVA_TEST_LIBRARIES constants
- Replace string literals in test classpath resolution
- Improve code formatting consistency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Replace string literal for sonar.verbose property with centralized constant.

Changes:
- Add VERBOSE constant to ScanPropertyNames
- Import and use VERBOSE in SonarTask debug logging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add class-level documentation to clarify the purpose of ScanPropertyNames
as a container for SonarQube scan property name constants.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This two classes have similar names, so it's important to have documentation clearly explaining their purpose.
Although they are deprecated for users of the scanner, we still need to include them for backward compatibility, so they should not be removed and not be marked as deprecated.
@romainbrenguier romainbrenguier force-pushed the romain/property-computer-clean-up branch from 213dff8 to 974e42d Compare November 24, 2025 09:58
@romainbrenguier romainbrenguier marked this pull request as ready for review November 24, 2025 13:02
Copy link
Contributor

@erwan-serandour erwan-serandour left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqube-next
Copy link

@romainbrenguier romainbrenguier merged commit 928532a into master Nov 25, 2025
36 of 37 checks passed
@romainbrenguier romainbrenguier deleted the romain/property-computer-clean-up branch November 25, 2025 09:25
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