Skip to content

Refactor: Resolve Sonar issues#2308

Merged
kthoms merged 3 commits into
mainfrom
refactor/reduce-method-complexity
Feb 6, 2026
Merged

Refactor: Resolve Sonar issues#2308
kthoms merged 3 commits into
mainfrom
refactor/reduce-method-complexity

Conversation

@kthoms

@kthoms kthoms commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

related to #511

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR resolves various Sonar code quality findings across multiple modules, focusing on reducing cognitive complexity, improving Java idiom usage, and fixing serialization issues.

Changes:

  • Extract methods in Tree.java to reduce cognitive complexity of the bind() method
  • Add transient modifiers to non-serializable fields in ProcessDefinitionEntity
  • Replace legacy Java patterns with modern idioms (computeIfAbsent, List.sort, Objects.requireNonNullElse) in GetActivityInstanceCmd
  • Suppress justified cognitive complexity warning in TypeConverterImpl

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
juel/src/main/java/org/operaton/bpm/impl/juel/TypeConverterImpl.java Adds Sonar suppression annotation for complex type coercion method
juel/src/main/java/org/operaton/bpm/impl/juel/Tree.java Extracts three helper methods (resolveIdentifiers, resolveFunctions, resolveFunction) to reduce complexity of bind() method
engine/src/main/java/org/operaton/bpm/engine/impl/persistence/entity/ProcessDefinitionEntity.java Marks runtime/cached fields as transient to prevent serialization issues
engine/src/main/java/org/operaton/bpm/engine/impl/cmd/GetActivityInstanceCmd.java Modernizes code with Java 8+ idioms (computeIfAbsent, List.sort, Objects.requireNonNullElse) and fixes comment punctuation

@sonarqubecloud

sonarqubecloud Bot commented Feb 5, 2026

Copy link
Copy Markdown

@kthoms kthoms added refactoring Code enhancement without changing API or behaviour scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI scope:juel Changes to the JUEL implementation labels Feb 6, 2026
@kthoms kthoms added this to the 1.1.0 milestone Feb 6, 2026
@kthoms kthoms merged commit c2f2864 into main Feb 6, 2026
23 of 24 checks passed
@kthoms kthoms deleted the refactor/reduce-method-complexity branch February 6, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code enhancement without changing API or behaviour scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI scope:juel Changes to the JUEL implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants