PR#37, which put cohesion and coupling into the city; ADR 0007
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.
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.
## 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)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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-032the export writesmutation-crap.ccscenario,cohesion.ccscenarioandcoupling.ccscenariobeside the city: schema version 3, arearloc, heightcomplexity, absolute colours; Mutation-CRAP as the page's link, cohesion 2 to 3, coupling from half and 90 % ofmaxEfferentCoupling.@MC-CC-033withoutmaxEfferentCouplingthe coupling scenario has no colour band, so the viewer uses its own thirds.@MC-CC-034the Mutation-CRAP link passes the three files as absolute URLs with the parameterscenario; 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
theLinkHandsTheViewerTheScenariosaRealBuildWritesAValidCityThe Solution
ColorBandholds where yellow and red start; the rules of the Mutation-CRAP bands moved there from the page, cohesion and coupling joined them.CodeCityScenarioswrites the three files; the export task writes them beside the city and knowsmaxEfferentCoupling.scenarioparameter per file; the other two links stay, for a viewer without scenario parameters.Prerequisite PRs
scenario(branchmihoe/scenario-url-param); without it, the parameter is ignored and the files can be imported by hand.🤖 Generated with Claude Code