You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An issue/feature request has been created for this PR
Pull Request title clearly describes the work in the pull request and the Pull Request description provides details about how to validate the work. Missing information here may result in a delayed response.
This PR refactors the checkJsonPathParameterValues() method in the EncryptionConfigBuilder class to reduce its cognitive complexity from 34 to the allowed 15, as highlighted by SonarCloud. The refactoring extracts repeated validation logic into smaller, focused helper methods to improve readability, maintainability, and testability without changing the original functionality.
Hi maintainers,
This PR refactors the method to reduce cognitive complexity as suggested by SonarCloud. It is ready for your review and approval. Please add the "safe" label to allow CI workflows to run. Thank you!
ShimonaR-MC
added
the
safe
The PR has been reviewed by Mastercard and has been validated to be safe
label
Sep 8, 2025
@VivekKumar97 Please fix the broken tests. @ShimonaR-MC I have made changes in error messages according to test expectations .
NOTE: The following test failures (FieldLevelEncryptionWithDefaultJsonEngineTest.testEncryptBytes_InteroperabilityTest and testDecryptBytes_InteroperabilityTest, and their subclasses) are already present on the main branch before my changes. My PR does not introduce new failures or alter the current test outcomes. Please advise if further action is needed regarding these existing test issues.
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
safeThe PR has been reviewed by Mastercard and has been validated to be safe
3 participants
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.
PR checklist
mainbranchLink to issue/feature request: https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=Mastercard_client-encryption-java&open=AYKH950-zJj43x5EL0Jr
Description
This PR refactors the checkJsonPathParameterValues() method in the EncryptionConfigBuilder class to reduce its cognitive complexity from 34 to the allowed 15, as highlighted by SonarCloud. The refactoring extracts repeated validation logic into smaller, focused helper methods to improve readability, maintainability, and testability without changing the original functionality.