Skip to content

refactor: extract insertEdge private method in BpmnRenderer#3524

Merged
tbouffard merged 2 commits into
masterfrom
refactor/labelBounds_in_style_computation
May 22, 2026
Merged

refactor: extract insertEdge private method in BpmnRenderer#3524
tbouffard merged 2 commits into
masterfrom
refactor/labelBounds_in_style_computation

Conversation

@tbouffard
Copy link
Copy Markdown
Member

Mirror the existing insertVertex helper by extracting an insertEdge private method that encapsulates edge cell
creation, waypoints insertion, and label-bounds geometry. The previous insertEdges loop inlined all three concerns,
producing an asymmetry with the shape path where insertVertex already encapsulates the equivalent responsibilities.

The waypoint-before-label-bounds ordering is preserved inside the new helper because computeEdgeCenter reads
edge.geometry.points, which is set by insertWaypoints. Message flow icon insertion stays at the loop level since it
is a separate child-cell concern rather than part of the edge cell geometry.

No behavior change: build, unit tests (BpmnRenderer.test.ts, 38 tests) and integration tests (14 suites, 312 tests)
all pass.

Mirror the existing insertVertex helper by extracting an insertEdge private method that encapsulates edge cell
creation, waypoints insertion, and label-bounds geometry. The previous insertEdges loop inlined all three concerns,
producing an asymmetry with the shape path where insertVertex already encapsulates the equivalent responsibilities.

The waypoint-before-label-bounds ordering is preserved inside the new helper because computeEdgeCenter reads
edge.geometry.points, which is set by insertWaypoints. Message flow icon insertion stays at the loop level since it
is a separate child-cell concern rather than part of the edge cell geometry.

No behavior change: build, unit tests (BpmnRenderer.test.ts, 38 tests) and integration tests (14 suites, 312 tests)
all pass.
@tbouffard tbouffard added refactoring Code refactoring skip CI e2e tests GitHub Actions do not run e2e tests (for Pull Requests) labels May 22, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

♻️ PR Preview 4e271dc has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

♻️ PR Preview 4e271dc has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Reduce insertEdge from 8 parameters to 1 by passing the Edge model directly instead of pre-derived primitives.
SonarCloud flagged the previous signature as exceeding its 7-parameter threshold; the fix also aligns the helper
with the existing insertShape pattern, which takes a Shape and derives parent/style/labelBounds internally.

The default parent, source/target cells, label bounds and style are all derivable from the Edge model itself, so
keeping them as parameters duplicated the caller logic. The new shape (insertEdges loop → insertEdge(internalEdge))
mirrors insertShapes → insertShape(shape) line for line.

No behavior change: build, unit tests (38) and integration tests (14 suites, 312 tests) all pass.
@sonarqubecloud
Copy link
Copy Markdown

@tbouffard tbouffard merged commit bc8de31 into master May 22, 2026
15 checks passed
@tbouffard tbouffard deleted the refactor/labelBounds_in_style_computation branch May 22, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code refactoring skip CI e2e tests GitHub Actions do not run e2e tests (for Pull Requests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant