Skip to content

Fix SonarQube code smells - add private constructor and reduce regex complexity - #1847

Merged
lbroudoux merged 1 commit into
microcks:1.13.xfrom
Caesarsage:fix/private-constructor-utf8checker
Dec 5, 2025
Merged

lbroudoux merged 1 commit into
microcks:1.13.xfrom
Caesarsage:fix/private-constructor-utf8checker

Conversation

@Caesarsage

Copy link
Copy Markdown
Contributor

Fixes two SonarQube issues in UTF8ContentTypeChecker:

  1. Add private constructor to hide implicit public one
  2. Simplify regular expression to reduce complexity from 21 to 20

Changes

  • Added private constructor to prevent instantiation of utility class
  • Refactored regex pattern to reduce cognitive complexity while maintaining functionality
  • All existing tests pass
image image

Related issue(s)

#1714

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but I have to admit I'm not 100% sure it's still working just by reading the regexp 😉 Let's see how the CI with tests goes! Thanks a lot!

@lbroudoux lbroudoux added this to the 1.13.1 milestone Dec 4, 2025
@lbroudoux lbroudoux added kind/task java Pull requests that update Java code labels Dec 4, 2025
@lbroudoux
lbroudoux merged commit b67dfcf into microcks:1.13.x Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code kind/task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants