Skip to content

fix: address SonarCloud findings - #189

Open
spannm wants to merge 3 commits into
SkillPanel:masterfrom
spannm:fix/sonar-findings
Open

spannm wants to merge 3 commits into
SkillPanel:masterfrom
spannm:fix/sonar-findings

Conversation

@spannm

@spannm spannm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes for the SonarCloud findings that were worth addressing: naming clashes, replace() instead of replaceAll(), protected constructors on abstract classes and a few regex simplifications. Accepted values stay the same.

PlPassportNumberProviderSpec also had a real gap: its letter and digit checks ran inside for loops in an expect block, so Spock never asserted them.

I skipped findings that would break the public API, such as the Country constant names.

Rename constants that clash with fields of the same name, use replace()
instead of replaceAll() for literal strings, make constructors of
abstract classes protected, drop redundant abstract redeclarations,
explain empty methods, use an EnumMap keyed by LanguageCode and tidy up
a few regular expressions. In the Groovy specs, remove an unused import
and add braces to single-statement if bodies.
The control character group ([KPQSABEH]|[0-9]|[A-Z]) is equivalent to
[0-9A-Z], since [A-Z] already covers the letter list. Simplify the
pattern without changing which values it accepts.
Statements inside a for loop in a Spock expect block are not treated as
implicit assertions, so the letter and digit checks never failed.
Replace the loops with top-level every() expressions.
@spannm
spannm requested a review from mariuszs October 10, 2026 15:19

This branch has not been deployed

No deployments
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.

1 participant