Repository navigation
Conversation
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.
This branch has not been deployed
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.
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.