One CodeCharta scenario per view (0.21.0) #40

Merged
mi merged 1 commits from mihoe/codecharta-scenarios into main 2026-10-04 14:39:28 +02:00
Owner

Related Links

The Problem

The city has three views, Mutation-CRAP, cohesion and coupling, each with colour bounds of its own.
The report page opened each by a link of its own; inside the viewer, switching meant choosing the colour metric and setting its bounds by hand.
CodeCharta has scenarios for this, saved views with metrics and colours, but they live in each browser and come in only by an import.

The Scenarios

  • @MC-CC-032 the export writes mutation-crap.ccscenario, cohesion.ccscenario and coupling.ccscenario beside the city: schema version 3, area rloc, height complexity, absolute colours; Mutation-CRAP as the page's link, cohesion 2 to 3, coupling from half and 90 % of maxEfferentCoupling.
  • @MC-CC-033 without maxEfferentCoupling the coupling scenario has no colour band, so the viewer uses its own thirds.
  • @MC-CC-034 the Mutation-CRAP link passes the three files as absolute URLs with the parameter scenario; the page offers them for download, for an import by hand into another viewer.

Both colour decisions were taken on 2026-10-04: cohesion fixed at 2 and 3, as every class that could be split is worth a look; coupling derived from the ratchet, as for Mutation-CRAP.

Verified by

The Solution

  • ColorBand holds where yellow and red start; the rules of the Mutation-CRAP bands moved there from the page, cohesion and coupling joined them.
  • CodeCityScenarios writes the three files; the export task writes them beside the city and knows maxEfferentCoupling.
  • The page's Mutation-CRAP link adds a scenario parameter per file; the other two links stay, for a viewer without scenario parameters.
  • Version 0.21.0.

Prerequisite PRs

  • The fork of the viewer at javagil.de reads scenario (branch mihoe/scenario-url-param); without it, the parameter is ignored and the files can be imported by hand.

🤖 Generated with Claude Code

## Related Links - [PR#37](2026-10-04-PR%2337-cohesion-coupling-city.md), which put cohesion and coupling into the city; [ADR 0007](../adr/0007-codecharta-export.md) ## The Problem The city has three views, Mutation-CRAP, cohesion and coupling, each with colour bounds of its own. The report page opened each by a link of its own; inside the viewer, switching meant choosing the colour metric and setting its bounds by hand. CodeCharta has scenarios for this, saved views with metrics and colours, but they live in each browser and come in only by an import. ## The Scenarios - `@MC-CC-032` the export writes `mutation-crap.ccscenario`, `cohesion.ccscenario` and `coupling.ccscenario` beside the city: schema version 3, area `rloc`, height `complexity`, absolute colours; Mutation-CRAP as the page's link, cohesion 2 to 3, coupling from half and 90 % of `maxEfferentCoupling`. - `@MC-CC-033` without `maxEfferentCoupling` the coupling scenario has no colour band, so the viewer uses its own thirds. - `@MC-CC-034` the Mutation-CRAP link passes the three files as absolute URLs with the parameter `scenario`; the page offers them for download, for an import by hand into another viewer. Both colour decisions were taken on 2026-10-04: cohesion fixed at 2 and 3, as every class that could be split is worth a look; coupling derived from the ratchet, as for Mutation-CRAP. ##### Verified by - [CodeCityScenariosTest](../../werkcrappit-pit/src/test/java/de/javagil/werkcrappit/pit/codecharta/CodeCityScenariosTest.java) - [CodeCityPageTest](../../werkcrappit-pit/src/test/java/de/javagil/werkcrappit/pit/codecharta/CodeCityPageTest.java) `theLinkHandsTheViewerTheScenarios` - [CodeChartaFunctionalTest](../../werkcrappit-gradle-plugin/src/functionalTest/java/de/javagil/werkcrappit/gradle/CodeChartaFunctionalTest.java) `aRealBuildWritesAValidCity` ## The Solution - `ColorBand` holds where yellow and red start; the rules of the Mutation-CRAP bands moved there from the page, cohesion and coupling joined them. - `CodeCityScenarios` writes the three files; the export task writes them beside the city and knows `maxEfferentCoupling`. - The page's Mutation-CRAP link adds a `scenario` parameter per file; the other two links stay, for a viewer without scenario parameters. - Version 0.21.0. ## Prerequisite PRs - The fork of the viewer at javagil.de reads `scenario` (branch `mihoe/scenario-url-param`); without it, the parameter is ignored and the files can be imported by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mi added 1 commit 2026-10-04 14:13:01 +02:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mi merged commit ca9d92cda1 into main 2026-10-04 14:39:28 +02:00
mi deleted branch mihoe/codecharta-scenarios 2026-10-04 14:39:28 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkcrappit#40