Refactor small maintainability issues in transformations, fake-value resolution and Irish PPSN generation#1871
Open
tawratnibir wants to merge 5 commits into
Open
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1871 +/- ##
============================================
+ Coverage 92.45% 92.52% +0.06%
- Complexity 3557 3563 +6
============================================
Files 345 346 +1
Lines 7025 7050 +25
Branches 685 685
============================================
+ Hits 6495 6523 +28
+ Misses 366 364 -2
+ Partials 164 163 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
This pull request makes a small set of maintainability-focused refactorings:
Classusage inJavaObjectTransformer.apply()withClass<?>and typedinstanceofhandling.dotIndex == -1branch from the privateFakeValuesService.resolveFakerObjectAndMethod()helper.indexOf()while the code usescontains("}").Why
These changes address small maintainability issues found during source inspection. They improve type clarity, remove unreachable control-flow noise, align comments with the current implementation, and separate checksum calculation from the high-level PPSN generation workflow.
The changes are intentionally small and avoid public API or generic-contract redesign.
Refactoring approach
The refactoring was kept local to the affected implementation details:
JavaObjectTransformer.apply()now usesClass<?>to represent an unknown class type more safely.FakeValuesService.resolveFakerObjectAndMethod()now reflects the verified private helper call contract more directly.FakeValuesService.resolveExpression()no longer contains a stale implementation-specific comment.IrishIdNumber.generateValid()now delegates weighted checksum accumulation tocalculateWeightedSum(...), while preserving the existing weights, suffix handling, multiplier, checksum character calculation and output format.Validation
The following validation was performed:
JavaObjectTransformerTestandJavaObjectTransformerConstructorTestpassed.FakeValuesServiceTestpassed.IrishIdNumberTestpassed.