Public report of yairm210/Unciv, published 13 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.3). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 13 November 2026, 19:18 UTC · Survey ID cd_a9f5ba6aee894cb8b46d3672c8fb3aef
yairm210/Unciv
Measured 13 November 2026, 19:16 UTC, at code version 90175e1
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 126,308 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Production Readiness, 31
Findings by how serious they are
112 critical957 serious82 minor
10 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 19:16 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
63of 63 dimensions measured by tools.
1132of 1151 findings point to an exact file and line, so you can open each one in the code. The other 19 concern the repository as a whole, such as missing documentation.
63dimensions across 6 lenses, read from 126,308 lines of product code in 11 projects.
yairm210/Unciv falls short of our standard for production, in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 43 out of 100 and is rated Weak, and 110 of its 112 critical findings are security problems.
Production Readiness, at 31, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 9 points. Adding automated security scanning would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 70 would lift the score to about 54.
Seventy-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Twenty secrets can leak from the build pipeline, and three passwords or keys in the code's history and one in the code are open to anyone who can read the repository. Replacing each exposed password or key, pinning each tool to an exact version and limiting each secret to its own step would close these risks. Giving the pull-request workflow read-only access would fix the three pipelines that outsiders can trigger with write access, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The part of the code nobody has worked on for a long time needs someone to learn and document it before anyone changes it.
The product code is 126,308 lines, about €130,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 31 to 70, the lowest score rated Strong, the score would rise from 43 to about 54.
Code composition: what the lines of code are
Product code 87%Tests 13%
New since the last survey: 172 findings
These 172 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FunctionTooLong: run-game.main REDACTED
God Classes · TooManyMethods: UnitMovement core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt
God Classes · ClassTooLong: Ruleset core/src/com/unciv/models/ruleset/Ruleset.kt
God Classes · FileTooLong: ruleset/Ruleset.kt core/src/com/unciv/models/ruleset/Ruleset.kt
God Classes · FunctionTooLong: browser-fetch-contract.main web/validation/http-fetch-engine/browser-fetch-contract.cjs
Code Duplication · Edited copy of a member (38 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt
Code Duplication · Edited copy of a member (43 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt
Code Duplication · Edited copy of a member (44 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt
Code Duplication · Edited copy of a member (31 corresponding lines) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt
Code Duplication · Edited copy of a member (30 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt
Code Duplication · Edited copy of a member (25 corresponding lines) core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt
Code Duplication · Edited copy of a member (35 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt
Code Duplication · Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt
Code Duplication · Edited copy of a member (28 corresponding lines) core/src/com/unciv/logic/map/mapunit/actions/UnitActionsReligion.kt
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/com/unciv/logic/civilization/Civilization.kt
Code Duplication · Edited copy of a member (39 corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt
Code Duplication · Edited copy of a member (14 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt
Code Duplication · Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/screens/worldscreen/status/AutoPlayMenu.kt
Code Duplication · Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt
Code Duplication · Edited copy of a member (17 corresponding lines) core/src/com/unciv/logic/automation/civilization/ThreatManager.kt
Code Duplication · Edited copy of a member (38 corresponding lines) core/src/com/unciv/logic/multiplayer/Multiplayer.kt
Code Duplication · Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt
Code Duplication · Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt
Code Duplication · Edited copy of a member (21 corresponding lines) core/src/com/unciv/logic/map/MapPathing.kt
Code Duplication · Edited copy of a member (17 corresponding lines) core/src/com/unciv/ui/images/ImageGetter.kt
Code Duplication · Edited copy of a member (20 corresponding lines) core/src/com/unciv/logic/files/UncivFiles.kt
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt
Code Duplication · Edited copy of a member (13 corresponding lines) android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt
Code Duplication · Edited copy of a member (10 corresponding lines) core/src/com/unciv/ui/screens/devconsole/CliInput.kt
Code Duplication · Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt
Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt
Code Duplication · Edited copy of a member (19 corresponding lines) core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/cityscreen/SpecialistAllocationTable.kt
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/com/unciv/ui/objectdescriptions/DescriptionHelpers.kt
Code Duplication · Edited copy of a member (18 corresponding lines) core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/civilization/Civilization.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt
Code Duplication · Edited copy of a member (11 corresponding lines) core/src/com/unciv/ui/popups/options/OptionsPopupHelpers.kt
Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) core/src/com/unciv/models/ruleset/nation/Nation.kt
Code Duplication · Edited copy of a member (4 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt
Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/models/ruleset/IConstruction.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/models/ruleset/unique/Countables.kt
Code Duplication · Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/civilization/CivConstructions.kt
Code Duplication · Edited copy of a member (19 corresponding lines) core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt
Code Duplication · Edited copy of a member (16 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt
Code Duplication · Edited copy of a member (15 corresponding lines) android/src/com/unciv/app/AndroidSaverLoader.kt
Code Duplication · Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/civilization/CivConstructions.kt
Code Duplication · Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt
Code Duplication · Edited copy of a member (17 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt
Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) core/src/com/unciv/ui/screens/cityscreen/CityMapHolder.kt
Code Duplication · Edited copy of a member (11 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/Perlin.kt
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt
Code Duplication · Edited copy of a member (8 corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt
Code Duplication · Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/map/mapunit/MapUnit.kt
Code Duplication · Edited copy of a member (8 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorFilesScroll.kt
Code Duplication · Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/battle/MapUnitCombatant.kt
Code Duplication · Edited copy of a member (14 corresponding lines) core/src/com/unciv/utils/LongPriorityQueue.kt
Code Duplication · Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt
Code Duplication · Edited copy of a member (3 corresponding lines) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt
Code Duplication · Edited copy of a member (5 corresponding lines) core/src/com/unciv/logic/city/City.kt
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 50 findings
These 50 critical or serious findings were in the previous survey, on 24 October 2026, and are gone from this one.
Exception handling · Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/newgamescreen/MapFileSelectTable.kt
Rebuild cost: about €130,000 · Estimate
Cost to rebuild
€42,000 to €210,000, for 698 to 2,213 hours of work, about 0.9 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 43. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 126,308 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Raises the score by about 6 points · Medium effort · DR & Backup
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €130,000 to build again, about 0.9 person-years of work. Its weakest lens is Production Readiness, at 31 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 9 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 8% on every change. The history of the code shows how much it changes: about 70,618 lines over the last 90 days, which is about 286,395 lines a year. At that pace, the extra work comes to an estimated 24.3 to 145.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
547 modules, with 1394 dependencies between them. 4 loops run through 162 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 507 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
models.ruleset.nation uses models.stats, so a change to models.stats can break models.ruleset.nation, while a change to models.ruleset.nation can't break models.stats.
Position
Below the diagonal: models.ruleset.nation uses a module listed above it, which is the healthy direction.
2→18 models.ruleset.nation uses ui.screens.civilopediascreenpart of a loop✕
Connections
3 pairs of types, where a type in models.ruleset.nation uses a type in ui.screens.civilopediascreen.
models.ruleset.nation uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break models.ruleset.nation, while a change to models.ruleset.nation can't break ui.screens.civilopediascreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
2→21 models.ruleset.nation uses models.ruleset.uniquepart of a loop✕
Connections
6 pairs of types, where a type in models.ruleset.nation uses a type in models.ruleset.unique.
models.ruleset.nation uses models.ruleset.unique, so a change to models.ruleset.unique can break models.ruleset.nation, while a change to models.ruleset.nation can't break models.ruleset.unique.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
2→23 models.ruleset.nation uses modelspart of a loop✕
Connections
1 pair of types, where a type in models.ruleset.nation uses a type in models.
models.ruleset.nation uses models.ruleset, so a change to models.ruleset can break models.ruleset.nation, while a change to models.ruleset.nation can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.overviewscreen uses models.stats, so a change to models.stats can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break models.stats.
Position
Below the diagonal: ui.screens.overviewscreen uses a module listed above it, which is the healthy direction.
3→7 ui.screens.overviewscreen uses viewpart of a loop✕
Connections
16 pairs of types, where a type in ui.screens.overviewscreen uses a type in view.
ui.screens.overviewscreen uses view, so a change to view can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break view.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→10 ui.screens.overviewscreen uses ui.screens.basescreenpart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.overviewscreen uses a type in ui.screens.basescreen.
ui.screens.overviewscreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→11 ui.screens.overviewscreen uses ui.components.widgetspart of a loop✕
Connections
10 pairs of types, where a type in ui.screens.overviewscreen uses a type in ui.components.widgets.
ui.screens.overviewscreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→12 ui.screens.overviewscreen uses ui.components.inputpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in ui.components.input.
ui.screens.overviewscreen uses ui.components.input, so a change to ui.components.input can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break ui.components.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→13 ui.screens.overviewscreen uses models.metadatapart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in models.metadata.
ui.screens.overviewscreen uses models.metadata, so a change to models.metadata can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break models.metadata.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→15 ui.screens.overviewscreen uses ui.componentspart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.overviewscreen uses a type in ui.components.
ui.screens.overviewscreen uses ui.components, so a change to ui.components can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break ui.components.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→23 ui.screens.overviewscreen uses modelspart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in models.
ui.screens.overviewscreen uses models, so a change to models can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→24 ui.screens.overviewscreen uses models.ruleset.tilepart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.overviewscreen uses a type in models.ruleset.tile.
ui.screens.overviewscreen uses models.ruleset.tile, so a change to models.ruleset.tile can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break models.ruleset.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→27 ui.screens.overviewscreen uses logic.mappart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in logic.map.
ui.screens.overviewscreen uses logic.map, so a change to logic.map can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break logic.map.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→28 ui.screens.overviewscreen uses models.rulesetpart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.overviewscreen uses a type in models.ruleset.
ui.screens.overviewscreen uses models.ruleset, so a change to models.ruleset can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→30 ui.screens.overviewscreen uses logic.civilizationpart of a loop✕
Connections
7 pairs of types, where a type in ui.screens.overviewscreen uses a type in logic.civilization.
ui.screens.overviewscreen uses logic.civilization, so a change to logic.civilization can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→31 ui.screens.overviewscreen uses logic.citypart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.overviewscreen uses a type in logic.city.
ui.screens.overviewscreen uses logic.city, so a change to logic.city can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→34 ui.screens.overviewscreen uses logicpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in logic.
ui.screens.overviewscreen uses logic, so a change to logic can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→38 ui.screens.overviewscreen uses com.uncivpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.overviewscreen uses a type in com.unciv.
ui.screens.overviewscreen uses com.unciv, so a change to com.unciv can break ui.screens.overviewscreen, while a change to ui.screens.overviewscreen can't break com.unciv.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.worldscreen uses ui.screens.overviewscreen, so a change to ui.screens.overviewscreen can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break ui.screens.overviewscreen.
Position
Below the diagonal: ui.screens.worldscreen uses a module listed above it, which is the healthy direction.
4→7 ui.screens.worldscreen uses viewpart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.worldscreen uses a type in view.
ui.screens.worldscreen uses ui.popups, so a change to ui.popups can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break ui.popups.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→9 ui.screens.worldscreen uses ui.popups.optionspart of a loop✕
Connections
1 pair of types, where a type in ui.screens.worldscreen uses a type in ui.popups.options.
ui.screens.worldscreen uses ui.popups.options, so a change to ui.popups.options can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break ui.popups.options.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→10 ui.screens.worldscreen uses ui.screens.basescreenpart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.worldscreen uses a type in ui.screens.basescreen.
ui.screens.worldscreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→11 ui.screens.worldscreen uses ui.components.widgetspart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.worldscreen uses a type in ui.components.widgets.
ui.screens.worldscreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→26 ui.screens.worldscreen uses logic.map.mapunitpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.worldscreen uses a type in logic.map.mapunit.
ui.screens.worldscreen uses logic.map.mapunit, so a change to logic.map.mapunit can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→28 ui.screens.worldscreen uses models.rulesetpart of a loop✕
Connections
4 pairs of types, where a type in ui.screens.worldscreen uses a type in models.ruleset.
ui.screens.worldscreen uses models.ruleset, so a change to models.ruleset can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→29 ui.screens.worldscreen uses logic.civilization.diplomacypart of a loop✕
Connections
1 pair of types, where a type in ui.screens.worldscreen uses a type in logic.civilization.diplomacy.
ui.screens.worldscreen uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break logic.civilization.diplomacy.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→30 ui.screens.worldscreen uses logic.civilizationpart of a loop✕
Connections
5 pairs of types, where a type in ui.screens.worldscreen uses a type in logic.civilization.
ui.screens.worldscreen uses logic.civilization, so a change to logic.civilization can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→31 ui.screens.worldscreen uses logic.citypart of a loop✕
Connections
1 pair of types, where a type in ui.screens.worldscreen uses a type in logic.city.
ui.screens.worldscreen uses logic.city, so a change to logic.city can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→34 ui.screens.worldscreen uses logicpart of a loop✕
Connections
5 pairs of types, where a type in ui.screens.worldscreen uses a type in logic.
ui.screens.worldscreen uses com.unciv, so a change to com.unciv can break ui.screens.worldscreen, while a change to ui.screens.worldscreen can't break com.unciv.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.pickerscreens uses models.stats, so a change to models.stats can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break models.stats.
Position
Below the diagonal: ui.screens.pickerscreens uses a module listed above it, which is the healthy direction.
ui.screens.pickerscreens uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break ui.screens.worldscreen.
Position
Below the diagonal: ui.screens.pickerscreens uses a module listed above it, which is the healthy direction.
5→7 ui.screens.pickerscreens uses viewpart of a loop✕
Connections
7 pairs of types, where a type in ui.screens.pickerscreens uses a type in view.
ui.screens.pickerscreens uses view, so a change to view can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break view.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→10 ui.screens.pickerscreens uses ui.screens.basescreenpart of a loop✕
Connections
7 pairs of types, where a type in ui.screens.pickerscreens uses a type in ui.screens.basescreen.
ui.screens.pickerscreens uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→11 ui.screens.pickerscreens uses ui.components.widgetspart of a loop✕
Connections
5 pairs of types, where a type in ui.screens.pickerscreens uses a type in ui.components.widgets.
ui.screens.pickerscreens uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→15 ui.screens.pickerscreens uses ui.componentspart of a loop✕
Connections
1 pair of types, where a type in ui.screens.pickerscreens uses a type in ui.components.
ui.screens.pickerscreens uses ui.components, so a change to ui.components can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break ui.components.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→19 ui.screens.pickerscreens uses models.ruleset.unitpart of a loop✕
Connections
4 pairs of types, where a type in ui.screens.pickerscreens uses a type in models.ruleset.unit.
ui.screens.pickerscreens uses models.ruleset.unit, so a change to models.ruleset.unit can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break models.ruleset.unit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→22 ui.screens.pickerscreens uses logic.civilization.managerspart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.pickerscreens uses a type in logic.civilization.managers.
ui.screens.pickerscreens uses logic.civilization.managers, so a change to logic.civilization.managers can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break logic.civilization.managers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→23 ui.screens.pickerscreens uses modelspart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.pickerscreens uses a type in models.
ui.screens.pickerscreens uses models, so a change to models can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→24 ui.screens.pickerscreens uses models.ruleset.tilepart of a loop✕
Connections
1 pair of types, where a type in ui.screens.pickerscreens uses a type in models.ruleset.tile.
ui.screens.pickerscreens uses models.ruleset.tile, so a change to models.ruleset.tile can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break models.ruleset.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→26 ui.screens.pickerscreens uses logic.map.mapunitpart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.pickerscreens uses a type in logic.map.mapunit.
ui.screens.pickerscreens uses logic.map.mapunit, so a change to logic.map.mapunit can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→28 ui.screens.pickerscreens uses models.rulesetpart of a loop✕
Connections
13 pairs of types, where a type in ui.screens.pickerscreens uses a type in models.ruleset.
ui.screens.pickerscreens uses models.ruleset, so a change to models.ruleset can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→30 ui.screens.pickerscreens uses logic.civilizationpart of a loop✕
Connections
10 pairs of types, where a type in ui.screens.pickerscreens uses a type in logic.civilization.
ui.screens.pickerscreens uses logic.civilization, so a change to logic.civilization can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→34 ui.screens.pickerscreens uses logicpart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.pickerscreens uses a type in logic.
ui.screens.pickerscreens uses logic, so a change to logic can break ui.screens.pickerscreens, while a change to ui.screens.pickerscreens can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.victoryscreen uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break ui.screens.worldscreen.
Position
Below the diagonal: ui.screens.victoryscreen uses a module listed above it, which is the healthy direction.
ui.screens.victoryscreen uses ui.screens.pickerscreens, so a change to ui.screens.pickerscreens can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break ui.screens.pickerscreens.
Position
Below the diagonal: ui.screens.victoryscreen uses a module listed above it, which is the healthy direction.
6→10 ui.screens.victoryscreen uses ui.screens.basescreenpart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.victoryscreen uses a type in ui.screens.basescreen.
ui.screens.victoryscreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→11 ui.screens.victoryscreen uses ui.components.widgetspart of a loop✕
Connections
10 pairs of types, where a type in ui.screens.victoryscreen uses a type in ui.components.widgets.
ui.screens.victoryscreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→25 ui.screens.victoryscreen uses logic.map.tilepart of a loop✕
Connections
2 pairs of types, where a type in ui.screens.victoryscreen uses a type in logic.map.tile.
ui.screens.victoryscreen uses logic.map.tile, so a change to logic.map.tile can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break logic.map.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→27 ui.screens.victoryscreen uses logic.mappart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.victoryscreen uses a type in logic.map.
ui.screens.victoryscreen uses logic.map, so a change to logic.map can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break logic.map.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→28 ui.screens.victoryscreen uses models.rulesetpart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.victoryscreen uses a type in models.ruleset.
ui.screens.victoryscreen uses models.ruleset, so a change to models.ruleset can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→30 ui.screens.victoryscreen uses logic.civilizationpart of a loop✕
Connections
10 pairs of types, where a type in ui.screens.victoryscreen uses a type in logic.civilization.
ui.screens.victoryscreen uses logic.civilization, so a change to logic.civilization can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→34 ui.screens.victoryscreen uses logicpart of a loop✕
Connections
5 pairs of types, where a type in ui.screens.victoryscreen uses a type in logic.
ui.screens.victoryscreen uses logic, so a change to logic can break ui.screens.victoryscreen, while a change to ui.screens.victoryscreen can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
view uses ui.screens.victoryscreen, so a change to ui.screens.victoryscreen can break view, while a change to view can't break ui.screens.victoryscreen.
Position
Below the diagonal: view uses a module listed above it, which is the healthy direction.
view uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break view, while a change to view can't break ui.screens.civilopediascreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
view uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break view, while a change to view can't break logic.civilization.diplomacy.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.popups uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.popups, while a change to ui.popups can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→11 ui.popups uses ui.components.widgetspart of a loop✕
Connections
2 pairs of types, where a type in ui.popups uses a type in ui.components.widgets.
ui.popups uses ui.components.widgets, so a change to ui.components.widgets can break ui.popups, while a change to ui.popups can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→12 ui.popups uses ui.components.inputpart of a loop✕
Connections
3 pairs of types, where a type in ui.popups uses a type in ui.components.input.
ui.popups uses ui.components.input, so a change to ui.components.input can break ui.popups, while a change to ui.popups can't break ui.components.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.popups uses models.ruleset.unit, so a change to models.ruleset.unit can break ui.popups, while a change to ui.popups can't break models.ruleset.unit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.popups.options uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.popups.options, while a change to ui.popups.options can't break ui.screens.basescreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→11 ui.popups.options uses ui.components.widgetspart of a loop✕
Connections
12 pairs of types, where a type in ui.popups.options uses a type in ui.components.widgets.
ui.popups.options uses ui.components.widgets, so a change to ui.components.widgets can break ui.popups.options, while a change to ui.popups.options can't break ui.components.widgets.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→12 ui.popups.options uses ui.components.inputpart of a loop✕
Connections
2 pairs of types, where a type in ui.popups.options uses a type in ui.components.input.
ui.popups.options uses ui.components.input, so a change to ui.components.input can break ui.popups.options, while a change to ui.popups.options can't break ui.components.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→13 ui.popups.options uses models.metadatapart of a loop✕
Connections
3 pairs of types, where a type in ui.popups.options uses a type in models.metadata.
ui.popups.options uses models.metadata, so a change to models.metadata can break ui.popups.options, while a change to ui.popups.options can't break models.metadata.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→17 ui.popups.options uses models.ruleset.validationpart of a loop✕
Connections
1 pair of types, where a type in ui.popups.options uses a type in models.ruleset.validation.
ui.popups.options uses models.ruleset.validation, so a change to models.ruleset.validation can break ui.popups.options, while a change to ui.popups.options can't break models.ruleset.validation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→28 ui.popups.options uses models.rulesetpart of a loop✕
Connections
1 pair of types, where a type in ui.popups.options uses a type in models.ruleset.
ui.popups.options uses models.ruleset, so a change to models.ruleset can break ui.popups.options, while a change to ui.popups.options can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→38 ui.popups.options uses com.uncivpart of a loop✕
Connections
2 pairs of types, where a type in ui.popups.options uses a type in com.unciv.
ui.screens.basescreen uses ui.popups.options, so a change to ui.popups.options can break ui.screens.basescreen, while a change to ui.screens.basescreen can't break ui.popups.options.
Position
Below the diagonal: ui.screens.basescreen uses a module listed above it, which is the healthy direction.
10→12 ui.screens.basescreen uses ui.components.inputpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.basescreen uses a type in ui.components.input.
ui.screens.basescreen uses ui.components.input, so a change to ui.components.input can break ui.screens.basescreen, while a change to ui.screens.basescreen can't break ui.components.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→23 ui.screens.basescreen uses modelspart of a loop✕
Connections
3 pairs of types, where a type in ui.screens.basescreen uses a type in models.
ui.screens.basescreen uses models.ruleset, so a change to models.ruleset can break ui.screens.basescreen, while a change to ui.screens.basescreen can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→38 ui.screens.basescreen uses com.uncivpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.basescreen uses a type in com.unciv.
ui.screens.basescreen uses com.unciv, so a change to com.unciv can break ui.screens.basescreen, while a change to ui.screens.basescreen can't break com.unciv.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.components.widgets uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.components.widgets, while a change to ui.components.widgets can't break ui.screens.basescreen.
Position
Below the diagonal: ui.components.widgets uses a module listed above it, which is the healthy direction.
11→12 ui.components.widgets uses ui.components.inputpart of a loop✕
Connections
4 pairs of types, where a type in ui.components.widgets uses a type in ui.components.input.
ui.components.widgets uses ui.components.input, so a change to ui.components.input can break ui.components.widgets, while a change to ui.components.widgets can't break ui.components.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→15 ui.components.widgets uses ui.componentspart of a loop✕
Connections
3 pairs of types, where a type in ui.components.widgets uses a type in ui.components.
ui.components.widgets uses ui.components, so a change to ui.components can break ui.components.widgets, while a change to ui.components.widgets can't break ui.components.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→16 ui.components.widgets uses ui.imagespart of a loop✕
Connections
1 pair of types, where a type in ui.components.widgets uses a type in ui.images.
ui.components.widgets uses ui.images, so a change to ui.images can break ui.components.widgets, while a change to ui.components.widgets can't break ui.images.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→23 ui.components.widgets uses modelspart of a loop✕
Connections
1 pair of types, where a type in ui.components.widgets uses a type in models.
ui.components.input uses ui.components.widgets, so a change to ui.components.widgets can break ui.components.input, while a change to ui.components.input can't break ui.components.widgets.
Position
Below the diagonal: ui.components.input uses a module listed above it, which is the healthy direction.
12→23 ui.components.input uses modelspart of a loop✕
Connections
4 pairs of types, where a type in ui.components.input uses a type in models.
models.metadata uses models.ruleset.nation, so a change to models.ruleset.nation can break models.metadata, while a change to models.metadata can't break models.ruleset.nation.
Position
Below the diagonal: models.metadata uses a module listed above it, which is the healthy direction.
models.metadata uses ui.screens.overviewscreen, so a change to ui.screens.overviewscreen can break models.metadata, while a change to models.metadata can't break ui.screens.overviewscreen.
Position
Below the diagonal: models.metadata uses a module listed above it, which is the healthy direction.
models.metadata uses ui.components.widgets, so a change to ui.components.widgets can break models.metadata, while a change to models.metadata can't break ui.components.widgets.
Position
Below the diagonal: models.metadata uses a module listed above it, which is the healthy direction.
models.metadata uses ui.components.input, so a change to ui.components.input can break models.metadata, while a change to models.metadata can't break ui.components.input.
Position
Below the diagonal: models.metadata uses a module listed above it, which is the healthy direction.
13→27 models.metadata uses logic.mappart of a loop✕
Connections
1 pair of types, where a type in models.metadata uses a type in logic.map.
models.metadata uses models.ruleset, so a change to models.ruleset can break models.metadata, while a change to models.metadata can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→30 models.metadata uses logic.civilizationpart of a loop✕
Connections
1 pair of types, where a type in models.metadata uses a type in logic.civilization.
models.metadata uses logic.civilization, so a change to logic.civilization can break models.metadata, while a change to models.metadata can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.components.tilegroups uses models.stats, so a change to models.stats can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break models.stats.
Position
Below the diagonal: ui.components.tilegroups uses a module listed above it, which is the healthy direction.
ui.components.tilegroups uses view, so a change to view can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break view.
Position
Below the diagonal: ui.components.tilegroups uses a module listed above it, which is the healthy direction.
ui.components.tilegroups uses ui.components.widgets, so a change to ui.components.widgets can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break ui.components.widgets.
Position
Below the diagonal: ui.components.tilegroups uses a module listed above it, which is the healthy direction.
ui.components.tilegroups uses models.metadata, so a change to models.metadata can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break models.metadata.
Position
Below the diagonal: ui.components.tilegroups uses a module listed above it, which is the healthy direction.
14→25 ui.components.tilegroups uses logic.map.tilepart of a loop✕
Connections
1 pair of types, where a type in ui.components.tilegroups uses a type in logic.map.tile.
ui.components.tilegroups uses logic.map.tile, so a change to logic.map.tile can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break logic.map.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→28 ui.components.tilegroups uses models.rulesetpart of a loop✕
Connections
1 pair of types, where a type in ui.components.tilegroups uses a type in models.ruleset.
ui.components.tilegroups uses models.ruleset, so a change to models.ruleset can break ui.components.tilegroups, while a change to ui.components.tilegroups can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.components uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.components, while a change to ui.components can't break ui.screens.basescreen.
Position
Below the diagonal: ui.components uses a module listed above it, which is the healthy direction.
ui.components uses ui.components.widgets, so a change to ui.components.widgets can break ui.components, while a change to ui.components can't break ui.components.widgets.
Position
Below the diagonal: ui.components uses a module listed above it, which is the healthy direction.
ui.components uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.components, while a change to ui.components can't break ui.components.tilegroups.
Position
Below the diagonal: ui.components uses a module listed above it, which is the healthy direction.
15→30 ui.components uses logic.civilizationpart of a loop✕
Connections
1 pair of types, where a type in ui.components uses a type in logic.civilization.
ui.components uses logic.civilization, so a change to logic.civilization can break ui.components, while a change to ui.components can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.images uses models.ruleset.nation, so a change to models.ruleset.nation can break ui.images, while a change to ui.images can't break models.ruleset.nation.
Position
Below the diagonal: ui.images uses a module listed above it, which is the healthy direction.
ui.images uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.images, while a change to ui.images can't break ui.components.tilegroups.
Position
Below the diagonal: ui.images uses a module listed above it, which is the healthy direction.
ui.images uses models.ruleset.validation, so a change to models.ruleset.validation can break ui.images, while a change to ui.images can't break models.ruleset.validation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→19 ui.images uses models.ruleset.unitpart of a loop✕
Connections
1 pair of types, where a type in ui.images uses a type in models.ruleset.unit.
ui.images uses models.ruleset.unit, so a change to models.ruleset.unit can break ui.images, while a change to ui.images can't break models.ruleset.unit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→28 ui.images uses models.rulesetpart of a loop✕
Connections
3 pairs of types, where a type in ui.images uses a type in models.ruleset.
models.ruleset.validation uses models.ruleset.nation, so a change to models.ruleset.nation can break models.ruleset.validation, while a change to models.ruleset.validation can't break models.ruleset.nation.
Position
Below the diagonal: models.ruleset.validation uses a module listed above it, which is the healthy direction.
models.ruleset.validation uses ui.images, so a change to ui.images can break models.ruleset.validation, while a change to models.ruleset.validation can't break ui.images.
Position
Below the diagonal: models.ruleset.validation uses a module listed above it, which is the healthy direction.
17→19 models.ruleset.validation uses models.ruleset.unitpart of a loop✕
Connections
4 pairs of types, where a type in models.ruleset.validation uses a type in models.ruleset.unit.
models.ruleset.validation uses models.ruleset.unit, so a change to models.ruleset.unit can break models.ruleset.validation, while a change to models.ruleset.validation can't break models.ruleset.unit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→21 models.ruleset.validation uses models.ruleset.uniquepart of a loop✕
Connections
10 pairs of types, where a type in models.ruleset.validation uses a type in models.ruleset.unique.
models.ruleset.validation uses models.ruleset.unique, so a change to models.ruleset.unique can break models.ruleset.validation, while a change to models.ruleset.validation can't break models.ruleset.unique.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→28 models.ruleset.validation uses models.rulesetpart of a loop✕
Connections
12 pairs of types, where a type in models.ruleset.validation uses a type in models.ruleset.
models.ruleset.validation uses models.ruleset, so a change to models.ruleset can break models.ruleset.validation, while a change to models.ruleset.validation can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.civilopediascreen uses ui.popups, so a change to ui.popups can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.popups.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.screens.basescreen.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses ui.components.input, so a change to ui.components.input can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.components.input.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.components.tilegroups.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses ui.images, so a change to ui.images can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break ui.images.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
ui.screens.civilopediascreen uses models.ruleset.validation, so a change to models.ruleset.validation can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break models.ruleset.validation.
Position
Below the diagonal: ui.screens.civilopediascreen uses a module listed above it, which is the healthy direction.
18→21 ui.screens.civilopediascreen uses models.ruleset.uniquepart of a loop✕
Connections
1 pair of types, where a type in ui.screens.civilopediascreen uses a type in models.ruleset.unique.
ui.screens.civilopediascreen uses models.ruleset.unique, so a change to models.ruleset.unique can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break models.ruleset.unique.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→24 ui.screens.civilopediascreen uses models.ruleset.tilepart of a loop✕
Connections
1 pair of types, where a type in ui.screens.civilopediascreen uses a type in models.ruleset.tile.
ui.screens.civilopediascreen uses models.ruleset.tile, so a change to models.ruleset.tile can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break models.ruleset.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→28 ui.screens.civilopediascreen uses models.rulesetpart of a loop✕
Connections
6 pairs of types, where a type in ui.screens.civilopediascreen uses a type in models.ruleset.
ui.screens.civilopediascreen uses models.ruleset, so a change to models.ruleset can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→34 ui.screens.civilopediascreen uses logicpart of a loop✕
Connections
1 pair of types, where a type in ui.screens.civilopediascreen uses a type in logic.
ui.screens.civilopediascreen uses logic, so a change to logic can break ui.screens.civilopediascreen, while a change to ui.screens.civilopediascreen can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
models.ruleset.unit uses models.stats, so a change to models.stats can break models.ruleset.unit, while a change to models.ruleset.unit can't break models.stats.
Position
Below the diagonal: models.ruleset.unit uses a module listed above it, which is the healthy direction.
models.ruleset.unit uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break models.ruleset.unit, while a change to models.ruleset.unit can't break ui.screens.civilopediascreen.
Position
Below the diagonal: models.ruleset.unit uses a module listed above it, which is the healthy direction.
19→21 models.ruleset.unit uses models.ruleset.uniquepart of a loop✕
Connections
9 pairs of types, where a type in models.ruleset.unit uses a type in models.ruleset.unique.
models.ruleset.unit uses models.ruleset.unique, so a change to models.ruleset.unique can break models.ruleset.unit, while a change to models.ruleset.unit can't break models.ruleset.unique.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→23 models.ruleset.unit uses modelspart of a loop✕
Connections
1 pair of types, where a type in models.ruleset.unit uses a type in models.
models.ruleset.unit uses logic.map.mapunit, so a change to logic.map.mapunit can break models.ruleset.unit, while a change to models.ruleset.unit can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→28 models.ruleset.unit uses models.rulesetpart of a loop✕
Connections
10 pairs of types, where a type in models.ruleset.unit uses a type in models.ruleset.
models.ruleset.unit uses models.ruleset, so a change to models.ruleset can break models.ruleset.unit, while a change to models.ruleset.unit can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→30 models.ruleset.unit uses logic.civilizationpart of a loop✕
Connections
2 pairs of types, where a type in models.ruleset.unit uses a type in logic.civilization.
models.ruleset.unit uses logic.civilization, so a change to logic.civilization can break models.ruleset.unit, while a change to models.ruleset.unit can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→31 models.ruleset.unit uses logic.citypart of a loop✕
Connections
3 pairs of types, where a type in models.ruleset.unit uses a type in logic.city.
models.ruleset.unit uses logic.city, so a change to logic.city can break models.ruleset.unit, while a change to models.ruleset.unit can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→34 models.ruleset.unit uses logicpart of a loop✕
Connections
1 pair of types, where a type in models.ruleset.unit uses a type in logic.
logic.battle uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.battle, while a change to logic.battle can't break models.ruleset.unit.
Position
Below the diagonal: logic.battle uses a module listed above it, which is the healthy direction.
20→21 logic.battle uses models.ruleset.uniquepart of a loop✕
Connections
15 pairs of types, where a type in logic.battle uses a type in models.ruleset.unique.
logic.battle uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.battle, while a change to logic.battle can't break models.ruleset.unique.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
logic.battle uses logic.map.mapunit, so a change to logic.map.mapunit can break logic.battle, while a change to logic.battle can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
logic.battle uses logic.civilization, so a change to logic.civilization can break logic.battle, while a change to logic.battle can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
models.ruleset.unique uses models.stats, so a change to models.stats can break models.ruleset.unique, while a change to models.ruleset.unique can't break models.stats.
Position
Below the diagonal: models.ruleset.unique uses a module listed above it, which is the healthy direction.
models.ruleset.unique uses logic.battle, so a change to logic.battle can break models.ruleset.unique, while a change to models.ruleset.unique can't break logic.battle.
Position
Below the diagonal: models.ruleset.unique uses a module listed above it, which is the healthy direction.
21→25 models.ruleset.unique uses logic.map.tilepart of a loop✕
Connections
2 pairs of types, where a type in models.ruleset.unique uses a type in logic.map.tile.
models.ruleset.unique uses logic.map.tile, so a change to logic.map.tile can break models.ruleset.unique, while a change to models.ruleset.unique can't break logic.map.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→26 models.ruleset.unique uses logic.map.mapunitpart of a loop✕
Connections
2 pairs of types, where a type in models.ruleset.unique uses a type in logic.map.mapunit.
models.ruleset.unique uses logic.map.mapunit, so a change to logic.map.mapunit can break models.ruleset.unique, while a change to models.ruleset.unique can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→28 models.ruleset.unique uses models.rulesetpart of a loop✕
Connections
4 pairs of types, where a type in models.ruleset.unique uses a type in models.ruleset.
models.ruleset.unique uses models.ruleset, so a change to models.ruleset can break models.ruleset.unique, while a change to models.ruleset.unique can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→30 models.ruleset.unique uses logic.civilizationpart of a loop✕
Connections
5 pairs of types, where a type in models.ruleset.unique uses a type in logic.civilization.
models.ruleset.unique uses logic.civilization, so a change to logic.civilization can break models.ruleset.unique, while a change to models.ruleset.unique can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→31 models.ruleset.unique uses logic.citypart of a loop✕
Connections
3 pairs of types, where a type in models.ruleset.unique uses a type in logic.city.
models.ruleset.unique uses logic.city, so a change to logic.city can break models.ruleset.unique, while a change to models.ruleset.unique can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→34 models.ruleset.unique uses logicpart of a loop✕
Connections
3 pairs of types, where a type in models.ruleset.unique uses a type in logic.
logic.civilization.managers uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.civilization.managers, while a change to logic.civilization.managers can't break models.ruleset.unit.
Position
Below the diagonal: logic.civilization.managers uses a module listed above it, which is the healthy direction.
logic.civilization.managers uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.civilization.managers, while a change to logic.civilization.managers can't break models.ruleset.unique.
Position
Below the diagonal: logic.civilization.managers uses a module listed above it, which is the healthy direction.
22→23 logic.civilization.managers uses modelspart of a loop✕
Connections
5 pairs of types, where a type in logic.civilization.managers uses a type in models.
logic.civilization.managers uses models, so a change to models can break logic.civilization.managers, while a change to logic.civilization.managers can't break models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→24 logic.civilization.managers uses models.ruleset.tilepart of a loop✕
Connections
2 pairs of types, where a type in logic.civilization.managers uses a type in models.ruleset.tile.
logic.civilization.managers uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.civilization.managers, while a change to logic.civilization.managers can't break models.ruleset.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→25 logic.civilization.managers uses logic.map.tilepart of a loop✕
Connections
6 pairs of types, where a type in logic.civilization.managers uses a type in logic.map.tile.
logic.civilization.managers uses logic.map.tile, so a change to logic.map.tile can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.map.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→26 logic.civilization.managers uses logic.map.mapunitpart of a loop✕
Connections
4 pairs of types, where a type in logic.civilization.managers uses a type in logic.map.mapunit.
logic.civilization.managers uses logic.map.mapunit, so a change to logic.map.mapunit can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→27 logic.civilization.managers uses logic.mappart of a loop✕
Connections
1 pair of types, where a type in logic.civilization.managers uses a type in logic.map.
logic.civilization.managers uses logic.map, so a change to logic.map can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.map.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→28 logic.civilization.managers uses models.rulesetpart of a loop✕
Connections
9 pairs of types, where a type in logic.civilization.managers uses a type in models.ruleset.
logic.civilization.managers uses models.ruleset, so a change to models.ruleset can break logic.civilization.managers, while a change to logic.civilization.managers can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→30 logic.civilization.managers uses logic.civilizationpart of a loop✕
Connections
10 pairs of types, where a type in logic.civilization.managers uses a type in logic.civilization.
logic.civilization.managers uses logic.civilization, so a change to logic.civilization can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→31 logic.civilization.managers uses logic.citypart of a loop✕
Connections
3 pairs of types, where a type in logic.civilization.managers uses a type in logic.city.
logic.civilization.managers uses logic.city, so a change to logic.city can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→34 logic.civilization.managers uses logicpart of a loop✕
Connections
9 pairs of types, where a type in logic.civilization.managers uses a type in logic.
logic.civilization.managers uses logic, so a change to logic can break logic.civilization.managers, while a change to logic.civilization.managers can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
models uses logic.civilization.managers, so a change to logic.civilization.managers can break models, while a change to models can't break logic.civilization.managers.
Position
Below the diagonal: models uses a module listed above it, which is the healthy direction.
23→26 models uses logic.map.mapunitpart of a loop✕
Connections
1 pair of types, where a type in models uses a type in logic.map.mapunit.
models.ruleset.tile uses models.stats, so a change to models.stats can break models.ruleset.tile, while a change to models.ruleset.tile can't break models.stats.
Position
Below the diagonal: models.ruleset.tile uses a module listed above it, which is the healthy direction.
models.ruleset.tile uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break models.ruleset.tile, while a change to models.ruleset.tile can't break ui.screens.civilopediascreen.
Position
Below the diagonal: models.ruleset.tile uses a module listed above it, which is the healthy direction.
models.ruleset.tile uses models.ruleset.unit, so a change to models.ruleset.unit can break models.ruleset.tile, while a change to models.ruleset.tile can't break models.ruleset.unit.
Position
Below the diagonal: models.ruleset.tile uses a module listed above it, which is the healthy direction.
models.ruleset.tile uses models.ruleset.unique, so a change to models.ruleset.unique can break models.ruleset.tile, while a change to models.ruleset.tile can't break models.ruleset.unique.
Position
Below the diagonal: models.ruleset.tile uses a module listed above it, which is the healthy direction.
models.ruleset.tile uses logic.map.tile, so a change to logic.map.tile can break models.ruleset.tile, while a change to models.ruleset.tile can't break logic.map.tile.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→26 models.ruleset.tile uses logic.map.mapunitpart of a loop✕
Connections
1 pair of types, where a type in models.ruleset.tile uses a type in logic.map.mapunit.
models.ruleset.tile uses logic.map.mapunit, so a change to logic.map.mapunit can break models.ruleset.tile, while a change to models.ruleset.tile can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→28 models.ruleset.tile uses models.rulesetpart of a loop✕
Connections
7 pairs of types, where a type in models.ruleset.tile uses a type in models.ruleset.
models.ruleset.tile uses models.ruleset, so a change to models.ruleset can break models.ruleset.tile, while a change to models.ruleset.tile can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→30 models.ruleset.tile uses logic.civilizationpart of a loop✕
Connections
1 pair of types, where a type in models.ruleset.tile uses a type in logic.civilization.
models.ruleset.tile uses logic.civilization, so a change to logic.civilization can break models.ruleset.tile, while a change to models.ruleset.tile can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
logic.map.tile uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.map.tile, while a change to logic.map.tile can't break models.ruleset.unique.
Position
Below the diagonal: logic.map.tile uses a module listed above it, which is the healthy direction.
logic.map.tile uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.map.tile, while a change to logic.map.tile can't break models.ruleset.tile.
Position
Below the diagonal: logic.map.tile uses a module listed above it, which is the healthy direction.
25→26 logic.map.tile uses logic.map.mapunitpart of a loop✕
Connections
2 pairs of types, where a type in logic.map.tile uses a type in logic.map.mapunit.
logic.map.tile uses logic.map.mapunit, so a change to logic.map.mapunit can break logic.map.tile, while a change to logic.map.tile can't break logic.map.mapunit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→27 logic.map.tile uses logic.mappart of a loop✕
Connections
2 pairs of types, where a type in logic.map.tile uses a type in logic.map.
logic.map.tile uses models.ruleset, so a change to models.ruleset can break logic.map.tile, while a change to logic.map.tile can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→30 logic.map.tile uses logic.civilizationpart of a loop✕
Connections
3 pairs of types, where a type in logic.map.tile uses a type in logic.civilization.
logic.map.tile uses logic.civilization, so a change to logic.civilization can break logic.map.tile, while a change to logic.map.tile can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→31 logic.map.tile uses logic.citypart of a loop✕
Connections
2 pairs of types, where a type in logic.map.tile uses a type in logic.city.
logic.map.mapunit uses ui.components, so a change to ui.components can break logic.map.mapunit, while a change to logic.map.mapunit can't break ui.components.
Position
Below the diagonal: logic.map.mapunit uses a module listed above it, which is the healthy direction.
logic.map.mapunit uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.map.mapunit, while a change to logic.map.mapunit can't break models.ruleset.unit.
Position
Below the diagonal: logic.map.mapunit uses a module listed above it, which is the healthy direction.
logic.map.mapunit uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.map.mapunit, while a change to logic.map.mapunit can't break models.ruleset.unique.
Position
Below the diagonal: logic.map.mapunit uses a module listed above it, which is the healthy direction.
logic.map.mapunit uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.map.mapunit, while a change to logic.map.mapunit can't break models.ruleset.tile.
Position
Below the diagonal: logic.map.mapunit uses a module listed above it, which is the healthy direction.
logic.map.mapunit uses logic.map.tile, so a change to logic.map.tile can break logic.map.mapunit, while a change to logic.map.mapunit can't break logic.map.tile.
Position
Below the diagonal: logic.map.mapunit uses a module listed above it, which is the healthy direction.
26→27 logic.map.mapunit uses logic.mappart of a loop✕
Connections
1 pair of types, where a type in logic.map.mapunit uses a type in logic.map.
logic.map.mapunit uses models.ruleset, so a change to models.ruleset can break logic.map.mapunit, while a change to logic.map.mapunit can't break models.ruleset.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→30 logic.map.mapunit uses logic.civilizationpart of a loop✕
Connections
1 pair of types, where a type in logic.map.mapunit uses a type in logic.civilization.
logic.map.mapunit uses logic.civilization, so a change to logic.civilization can break logic.map.mapunit, while a change to logic.map.mapunit can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→31 logic.map.mapunit uses logic.citypart of a loop✕
Connections
1 pair of types, where a type in logic.map.mapunit uses a type in logic.city.
logic.map uses models.ruleset.nation, so a change to models.ruleset.nation can break logic.map, while a change to logic.map can't break models.ruleset.nation.
Position
Below the diagonal: logic.map uses a module listed above it, which is the healthy direction.
logic.map uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.map, while a change to logic.map can't break models.ruleset.unit.
Position
Below the diagonal: logic.map uses a module listed above it, which is the healthy direction.
logic.map uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.map, while a change to logic.map can't break models.ruleset.tile.
Position
Below the diagonal: logic.map uses a module listed above it, which is the healthy direction.
models.ruleset uses models.ruleset.nation, so a change to models.ruleset.nation can break models.ruleset, while a change to models.ruleset can't break models.ruleset.nation.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses models.metadata, so a change to models.metadata can break models.ruleset, while a change to models.ruleset can't break models.metadata.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses models.ruleset.validation, so a change to models.ruleset.validation can break models.ruleset, while a change to models.ruleset can't break models.ruleset.validation.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break models.ruleset, while a change to models.ruleset can't break ui.screens.civilopediascreen.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses models.ruleset.unit, so a change to models.ruleset.unit can break models.ruleset, while a change to models.ruleset can't break models.ruleset.unit.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in models.ruleset uses a type in models.ruleset.unique. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
models.ruleset uses models.ruleset.unique, so a change to models.ruleset.unique can break models.ruleset, while a change to models.ruleset can't break models.ruleset.unique.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses models.ruleset.tile, so a change to models.ruleset.tile can break models.ruleset, while a change to models.ruleset can't break models.ruleset.tile.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses logic.map.mapunit, so a change to logic.map.mapunit can break models.ruleset, while a change to models.ruleset can't break logic.map.mapunit.
Position
Below the diagonal: models.ruleset uses a module listed above it, which is the healthy direction.
models.ruleset uses logic.civilization, so a change to logic.civilization can break models.ruleset, while a change to models.ruleset can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
28→31 models.ruleset uses logic.citypart of a loop✕
Connections
7 pairs of types, where a type in models.ruleset uses a type in logic.city.
logic.civilization.diplomacy uses models.stats, so a change to models.stats can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break models.stats.
Position
Below the diagonal: logic.civilization.diplomacy uses a module listed above it, which is the healthy direction.
logic.civilization.diplomacy uses models.ruleset.nation, so a change to models.ruleset.nation can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break models.ruleset.nation.
Position
Below the diagonal: logic.civilization.diplomacy uses a module listed above it, which is the healthy direction.
logic.civilization.diplomacy uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break models.ruleset.unique.
Position
Below the diagonal: logic.civilization.diplomacy uses a module listed above it, which is the healthy direction.
logic.civilization.diplomacy uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break models.ruleset.tile.
Position
Below the diagonal: logic.civilization.diplomacy uses a module listed above it, which is the healthy direction.
logic.civilization.diplomacy uses models.ruleset, so a change to models.ruleset can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break models.ruleset.
Position
Below the diagonal: logic.civilization.diplomacy uses a module listed above it, which is the healthy direction.
29→30 logic.civilization.diplomacy uses logic.civilizationpart of a loop✕
Connections
9 pairs of types, where a type in logic.civilization.diplomacy uses a type in logic.civilization.
logic.civilization.diplomacy uses logic.civilization, so a change to logic.civilization can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break logic.civilization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29→34 logic.civilization.diplomacy uses logicpart of a loop✕
Connections
2 pairs of types, where a type in logic.civilization.diplomacy uses a type in logic.
logic.civilization.diplomacy uses logic, so a change to logic can break logic.civilization.diplomacy, while a change to logic.civilization.diplomacy can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
logic.civilization uses models.stats, so a change to models.stats can break logic.civilization, while a change to logic.civilization can't break models.stats.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses models.ruleset.nation, so a change to models.ruleset.nation can break logic.civilization, while a change to logic.civilization can't break models.ruleset.nation.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses ui.screens.overviewscreen, so a change to ui.screens.overviewscreen can break logic.civilization, while a change to logic.civilization can't break ui.screens.overviewscreen.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break logic.civilization, while a change to logic.civilization can't break ui.screens.worldscreen.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses ui.screens.victoryscreen, so a change to ui.screens.victoryscreen can break logic.civilization, while a change to logic.civilization can't break ui.screens.victoryscreen.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.civilization, while a change to logic.civilization can't break models.ruleset.unit.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.civilization, while a change to logic.civilization can't break models.ruleset.unique.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses logic.civilization.managers, so a change to logic.civilization.managers can break logic.civilization, while a change to logic.civilization can't break logic.civilization.managers.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.civilization, while a change to logic.civilization can't break models.ruleset.tile.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses logic.map.tile, so a change to logic.map.tile can break logic.civilization, while a change to logic.civilization can't break logic.map.tile.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses logic.map.mapunit, so a change to logic.map.mapunit can break logic.civilization, while a change to logic.civilization can't break logic.map.mapunit.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses models.ruleset, so a change to models.ruleset can break logic.civilization, while a change to logic.civilization can't break models.ruleset.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
logic.civilization uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break logic.civilization, while a change to logic.civilization can't break logic.civilization.diplomacy.
Position
Below the diagonal: logic.civilization uses a module listed above it, which is the healthy direction.
30→31 logic.civilization uses logic.citypart of a loop✕
Connections
2 pairs of types, where a type in logic.civilization uses a type in logic.city.
logic.civilization uses logic.city, so a change to logic.city can break logic.civilization, while a change to logic.civilization can't break logic.city.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30→34 logic.civilization uses logicpart of a loop✕
Connections
12 pairs of types, where a type in logic.civilization uses a type in logic.
logic.city uses ui.components.input, so a change to ui.components.input can break logic.city, while a change to logic.city can't break ui.components.input.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.city uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break logic.city, while a change to logic.city can't break ui.screens.civilopediascreen.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.city uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.city, while a change to logic.city can't break models.ruleset.unit.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.city uses models.ruleset.unique, so a change to models.ruleset.unique can break logic.city, while a change to logic.city can't break models.ruleset.unique.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.city uses models.ruleset.tile, so a change to models.ruleset.tile can break logic.city, while a change to logic.city can't break models.ruleset.tile.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.city uses logic.civilization, so a change to logic.civilization can break logic.city, while a change to logic.city can't break logic.civilization.
Position
Below the diagonal: logic.city uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses view, so a change to view can break logic.automation.civilization, while a change to logic.automation.civilization can't break view.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses models.ruleset.unit, so a change to models.ruleset.unit can break logic.automation.civilization, while a change to logic.automation.civilization can't break models.ruleset.unit.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses models, so a change to models can break logic.automation.civilization, while a change to logic.automation.civilization can't break models.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.map.tile, so a change to logic.map.tile can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.map.tile.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.map.mapunit, so a change to logic.map.mapunit can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.map.mapunit.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.map, so a change to logic.map can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.map.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses models.ruleset, so a change to models.ruleset can break logic.automation.civilization, while a change to logic.automation.civilization can't break models.ruleset.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.civilization.diplomacy.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.civilization, so a change to logic.civilization can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.civilization.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
logic.automation.civilization uses logic.city, so a change to logic.city can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.city.
Position
Below the diagonal: logic.automation.civilization uses a module listed above it, which is the healthy direction.
32→34 logic.automation.civilization uses logicpart of a loop✕
Connections
4 pairs of types, where a type in logic.automation.civilization uses a type in logic.
logic.automation.civilization uses logic, so a change to logic can break logic.automation.civilization, while a change to logic.automation.civilization can't break logic.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.cityscreen uses models.stats, so a change to models.stats can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break models.stats.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.popups, so a change to ui.popups can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.popups.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.screens.basescreen.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.components.input, so a change to ui.components.input can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.components.input.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses models.metadata, so a change to models.metadata can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break models.metadata.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.components.tilegroups.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.components, so a change to ui.components can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.components.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses ui.images, so a change to ui.images can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break ui.images.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses models.ruleset, so a change to models.ruleset can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break models.ruleset.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
ui.screens.cityscreen uses logic.city, so a change to logic.city can break ui.screens.cityscreen, while a change to ui.screens.cityscreen can't break logic.city.
Position
Below the diagonal: ui.screens.cityscreen uses a module listed above it, which is the healthy direction.
logic uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break logic, while a change to logic can't break logic.civilization.diplomacy.
Position
Below the diagonal: logic uses a module listed above it, which is the healthy direction.
logic uses logic.automation.civilization, so a change to logic.automation.civilization can break logic, while a change to logic can't break logic.automation.civilization.
Position
Below the diagonal: logic uses a module listed above it, which is the healthy direction.
logic.files uses ui.components.widgets, so a change to ui.components.widgets can break logic.files, while a change to logic.files can't break ui.components.widgets.
Position
Below the diagonal: logic.files uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses models.stats, so a change to models.stats can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break models.stats.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break ui.screens.worldscreen.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses ui.popups, so a change to ui.popups can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break ui.popups.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses models.ruleset.tile, so a change to models.ruleset.tile can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break models.ruleset.tile.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses logic.map.tile, so a change to logic.map.tile can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break logic.map.tile.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses logic.map.mapunit, so a change to logic.map.mapunit can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break logic.map.mapunit.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses logic.civilization.diplomacy, so a change to logic.civilization.diplomacy can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break logic.civilization.diplomacy.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses logic.civilization, so a change to logic.civilization can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break logic.civilization.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.devconsole uses logic.city, so a change to logic.city can break ui.screens.devconsole, while a change to ui.screens.devconsole can't break logic.city.
Position
Below the diagonal: ui.screens.devconsole uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses models.ruleset.nation, so a change to models.ruleset.nation can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break models.ruleset.nation.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses ui.screens.pickerscreens, so a change to ui.screens.pickerscreens can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break ui.screens.pickerscreens.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses ui.screens.victoryscreen, so a change to ui.screens.victoryscreen can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break ui.screens.victoryscreen.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses ui.popups, so a change to ui.popups can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break ui.popups.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break ui.screens.basescreen.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses models.metadata, so a change to models.metadata can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break models.metadata.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses logic.map, so a change to logic.map can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break logic.map.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses models.ruleset, so a change to models.ruleset can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break models.ruleset.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
ui.screens.newgamescreen uses logic, so a change to logic can break ui.screens.newgamescreen, while a change to ui.screens.newgamescreen can't break logic.
Position
Below the diagonal: ui.screens.newgamescreen uses a module listed above it, which is the healthy direction.
com.unciv uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break com.unciv, while a change to com.unciv can't break ui.screens.worldscreen.
Position
Below the diagonal: com.unciv uses a module listed above it, which is the healthy direction.
com.unciv uses ui.screens.basescreen, so a change to ui.screens.basescreen can break com.unciv, while a change to com.unciv can't break ui.screens.basescreen.
Position
Below the diagonal: com.unciv uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses models.ruleset.nation, so a change to models.ruleset.nation can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break models.ruleset.nation.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.components.tilegroups.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses ui.components, so a change to ui.components can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.components.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses ui.screens.civilopediascreen, so a change to ui.screens.civilopediascreen can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.screens.civilopediascreen.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses models, so a change to models can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break models.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses models.ruleset.tile, so a change to models.ruleset.tile can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break models.ruleset.tile.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses logic.map.tile, so a change to logic.map.tile can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break logic.map.tile.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses logic.map, so a change to logic.map can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break logic.map.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses models.ruleset, so a change to models.ruleset can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break models.ruleset.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses logic.civilization, so a change to logic.civilization can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break logic.civilization.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen.tabs uses ui.screens.newgamescreen, so a change to ui.screens.newgamescreen can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.screens.newgamescreen.
Position
Below the diagonal: ui.screens.mapeditorscreen.tabs uses a module listed above it, which is the healthy direction.
39→40 ui.screens.mapeditorscreen.tabs uses ui.screens.mapeditorscreenpart of a loop✕
Connections
10 pairs of types, where a type in ui.screens.mapeditorscreen.tabs uses a type in ui.screens.mapeditorscreen.
ui.screens.mapeditorscreen.tabs uses ui.screens.mapeditorscreen, so a change to ui.screens.mapeditorscreen can break ui.screens.mapeditorscreen.tabs, while a change to ui.screens.mapeditorscreen.tabs can't break ui.screens.mapeditorscreen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
ui.screens.mapeditorscreen uses ui.screens.worldscreen, so a change to ui.screens.worldscreen can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break ui.screens.worldscreen.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses ui.screens.basescreen, so a change to ui.screens.basescreen can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break ui.screens.basescreen.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses ui.components.widgets, so a change to ui.components.widgets can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break ui.components.widgets.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses ui.components.tilegroups, so a change to ui.components.tilegroups can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break ui.components.tilegroups.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses logic.map.tile, so a change to logic.map.tile can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break logic.map.tile.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses logic.map, so a change to logic.map can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break logic.map.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses models.ruleset, so a change to models.ruleset can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break models.ruleset.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
ui.screens.mapeditorscreen uses ui.screens.mapeditorscreen.tabs, so a change to ui.screens.mapeditorscreen.tabs can break ui.screens.mapeditorscreen, while a change to ui.screens.mapeditorscreen can't break ui.screens.mapeditorscreen.tabs.
Position
Below the diagonal: ui.screens.mapeditorscreen uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 44% · Weak · gated by D2, R1 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
107
High / Critical
A03:2025 — Software Supply Chain Failures
13
High / Critical
A07:2025 — Authentication Failures
5
High / Critical
A02:2025 — Security Misconfiguration
4
Medium
Roadmap
Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Resolve the 1 finding(s) in DR & Backup.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 112
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 957
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 82
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 10
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 63 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 63 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1132 of 1151 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Gradle build resolved 300 artifact(s) across its subprojects (188 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `android/assets/Atlases.json`, `android/assets/jsons/Tutorials.json` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `core/src/com/unciv/logic/civilization/Civilization.kt`, `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt`, `core/src/com/unciv/logic/github/GithubAPI.kt`, `core/src/com/unciv/logic/map/HexMath.kt`, `core/src/com/unciv/logic/map/mapgenerator/MapGenerationRandomness.kt`, … (+46 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in core/src/com/unciv/logic/multiplayer/apiv2/EndpointImplementations.kt, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit 15 — the compose project is invalid) — validating docker-compose.yml: services.unciv.volumes must be a list; runtime evidence skipped.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Java, Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
165 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was UniqueTriggerActivation.getTriggerFunction at 331. A further 8 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being UiUnitAction.getIcon at 57 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: core/src/com/unciv/ui/screens/worldscreen/unit/actions/UiUnitAction.kt (UiUnitAction.getIcon at 57), core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt (MapLandmassGenerator.generateLand at 17), core/src/com/unciv/logic/multiplayer/apiv2/JsonSerializers.kt (WebSocketMessageSerializer.selectDeserializer at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 158 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with UniqueTriggerActivation.getTriggerFunction (cyclomatic 331), Conditionals.conditionalApplies (cyclomatic 162), Building.getRejectionReasons (cyclomatic 62). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 4.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 293 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with UniqueTriggerActivation.getTriggerFunction (cognitive 501). — Refactoring it lifts Cognitive Complexity from 2.1 to about 4.5/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 34 TooManyMethods finding(s) in God Classes — start with Civilization.kt, Tile.kt, MapUnit.kt. — One of this dimension's main actionable groups (34 warning-level).
Resolve the 22 FileTooLong finding(s) in God Classes — start with UniqueTriggerActivation.kt, TextureArraySpriteBatch.java, Civilization.kt. — One of this dimension's main actionable groups (22 warning-level).
Resolve the 21 ClassTooLong finding(s) in God Classes — start with TextureArraySpriteBatch.java, Tile.kt, Civilization.kt. — One of this dimension's main actionable groups (21 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
55 duplicated block group(s) detected. A further 66 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
Edited copy of a member (9 corresponding lines) · ×8core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:406
+ 54 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with DiplomacyFunctions.kt (2), TechnologyDescriptions.kt, IConstruction.kt. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 8 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with PathingMap.kt, Simulation.kt, Belief.kt. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 Edited copy of a member (13 corresponding lines) finding(s) in Code Duplication — start with MultiplayerTurnCheckWorker.kt, SpecialistAllocationTable.kt, Civilization.kt. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.3 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
11 production modules (Gradle), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 1 module(s) off the main sequence, with abstractness counted on 9 of the 11 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: .:core
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with ModConstants.kt, CrashScreen.kt, DiplomacyScreen.kt. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 29 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 13 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 8 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 42 Hotspot finding(s) in Churn × Complexity Hotspots — start with UniqueTriggerActivation.kt, WorldMapTileUpdater.kt, UnitAutomation.kt. — One of this dimension's main actionable groups (42 warning-level).
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with GlobalPoliticsDiagramGroup.kt. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.4 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
88 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is core/src/com/unciv/models/ruleset/unique/DeprecatedUniques.kt. Counted over 559 of the 738 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)
What to do
Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
166 deducted task-comment markers across 126308 LoC (0.1/KLoC) → score 9.7. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 165 TodoComment finding(s) in Explicit Debt — start with MapEditorScreen.kt (15), UniqueType.kt (11), ConstructionAutomation.kt (6). — One of this dimension's main actionable groups (165 warning-level).
Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with TileLayerMisc.kt. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 217 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
2 naming inconsistencies among 32 declarations measured against a convention their peers follow.
`uncivRepoURL` spells `URL` where 30 names in the project spell it `Url`core/src/com/unciv/Constants.kt:142
`wikiURL` spells `URL` where 30 names in the project spell it `Url`core/src/com/unciv/Constants.kt:144
What to do
Resolve the 1 `uncivRepoURL` spells `URL` where 30 names in the project spell it `Url` finding(s) in Naming Consistency — start with Constants.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `wikiURL` spells `URL` where 30 names in the project spell it `Url` finding(s) in Naming Consistency — start with Constants.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 10 build units (Gradle) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
82 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
107 finding(s): 0 critical, 103 high, 4 medium, 0 low. 79 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 1 file(s) — `gradlew` (line 74, line 178) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (15), REDACTED, REDACTED. — One of this dimension's main actionable groups (17 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 79 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (79 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
23 of 559 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt. Counted over 559 of the 738 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with ApiV2.kt. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 22 Orphaned file finding(s) in Knowledge Freshness — start with ZoomableScrollPane.kt, ResponseStructs.kt, WebSocketStructs.kt. — One of this dimension's main actionable groups (22 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 6 Change coupling finding(s) in Change Coupling — start with Conditionals.kt, BuildConfig.kt, NextTurnAutomation.kt. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 10 platform declaration(s) and 42 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Only 5/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `web/validation/desktop-network-contract`, `web/validation/http-fetch-engine`, `web/validation/json-roundtrip`, `web/validation/reflection-field`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (Spring Boot Actuator's /actuator/health, or a /health route) so orchestrators and load balancers can probe liveness/readiness.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 11 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:16
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`HttpClient {` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — core/src/com/unciv/logic/multiplayer/chat/ChatWebSocket.kt:97, web/validation/desktop-network-contract/src/main/kotlin/com/unciv/logic/multiplayer/apiv2/Main.kt:26
`.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — core/src/com/unciv/logic/multiplayer/storage/DropBox.kt:28
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — web/validation/http-fetch-engine/browser-fetch-contract.cjs:82, web/validation/http-fetch-engine/browser-fetch-contract.cjs:100
What to do
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`getPreviewImageOrNull` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — core/src/com/unciv/logic/github/Github.kt:125
`awaitPing` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:340
`zlib.gzipSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — web/validation/http-fetch-engine/browser-fetch-contract.cjs:24
What to do
Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 7 plain JS — the untyped files are REDACTED, web/validation/http-fetch-engine/browser-fetch-contract.cjs, web/validation/http-fetch-engine/run.cjs, web/validation/json-roundtrip/run.cjs, web/validation/reflection-field/run.cjs, REDACTED (+1 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
web/validation/json-roundtrip/run.cjs:2 · web/validation/reflection-field/run.cjs:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/validation/json-roundtrip/run.cjs:2
REDACTED:83 · REDACTED:145 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:83
REDACTED:173 · REDACTED:137 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:173
REDACTED:4 · REDACTED:4 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — REDACTED:4
web/validation/http-fetch-engine/run.cjs:91 · web/validation/http-fetch-engine/run.cjs:99 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/validation/http-fetch-engine/run.cjs:91
web/validation/http-fetch-engine/run.cjs:57 · web/validation/http-fetch-engine/run.cjs:68 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/validation/http-fetch-engine/run.cjs:57
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
REDACTED:8 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead. — REDACTED:8
web/validation/http-fetch-engine/browser-fetch-contract.cjs:5 reaches into another package with a relative path (../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead. — web/validation/http-fetch-engine/browser-fetch-contract.cjs:5
REDACTED:9 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead. — REDACTED:9
REDACTED:9 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead. — REDACTED:9
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
main has cyclomatic complexity 26 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/validation/http-fetch-engine/browser-fetch-contract.cjs:22
(anonymous) has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:67
fetch has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/validation/http-fetch-engine/run.cjs:18
Do you agree with this assessment?
R3 · Large Files10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Do you agree with this assessment?
R7 · Dead Code4.3 / 10Weak✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 4 application, 2 tooling and 0 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
no import path from any entry point (4 application, 2 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×3) — web/validation/http-fetch-engine/run.cjs, web/validation/json-roundtrip/run.cjs, web/validation/reflection-field/run.cjs
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
`runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too. — core/src/com/unciv/logic/github/Github.kt:133
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream3.5 / 10Weak✓ Tool-verified
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`). — desktop/src/com/unciv/app/desktop/SystemUtils.kt:80
What to do
Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or the coroutine's cancellation (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated7.8 / 10Strong✓ Tool-verified
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
`gameDetails.keys` is a live view over `gameDetails` and shares its modification count; it is walked by the loop on line 238, and line 240 calls `gameDetails.remove` on `gameDetails` inside the loop body — a structural change to a `LinkedHashMap`. The loop's hidden iterator is fail-fast, so its next `next()` throws `ConcurrentModificationException`: every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen. — core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:238
What to do
Each finding names the two spans that cannot both stand — the enhanced `for` source, and the call inside the body that structurally changes that same collection. Confirm from those two, then pick one: remove through the iterator itself (`Iterator<T> it = c.iterator(); … it.remove();`) or replace the loop with `c.removeIf(…)`; iterate a copy (`for (T x : new ArrayList<>(c))`); collect what needs changing and apply it after the loop; or — where the loop was only ever meant to act on the first match — `break` immediately after the mutation, which is the one shape that is already safe. In Kotlin: Each finding names the two lines that cannot both stand — the loop over the collection, and the call inside its body that changes it. Confirm from those two, then pick one: change the collection in one call instead of in the loop (`list.removeAll { … }`, `list.retainAll { … }`, `map.entries.removeIf { … }`); walk a snapshot (`for (x in list.toList())`, `list.toList().forEach { … }`); build a new collection (`val kept = list.filter { … }`) instead of editing the one being walked; or — where only the first match was ever meant — leave the walk straight after the change (`break`, `return`), which is the one shape that is already safe.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×16) — server/src/com/unciv/app/server/UncivServer.kt:155, server/src/com/unciv/app/server/UncivServer.kt:300, desktop/src/com/unciv/app/desktop/DesktopGame.kt:62, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×6) — desktop/src/com/unciv/app/desktop/DesktopLauncher.kt:159, core/src/com/unciv/ui/screens/newgamescreen/MapFileSelectTable.kt:327, core/src/com/unciv/ui/components/fonts/FontRulesetIcons.kt:109, …
`catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — core/src/com/unciv/ui/screens/savescreens/LoadOrSaveScreen.kt:179, core/src/com/unciv/logic/map/TileMap.kt:552, core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:27, …
`catch (ex: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:199
`catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — core/src/com/unciv/logic/multiplayer/Multiplayer.kt:68
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~10.3 `!!` not-null assertions per 1k Kotlin product lines — 1490 across the 144024 line(s) of the 718 Kotlin file(s) read (generated, test and sample code not counted). Densest: core/src/com/unciv/logic/simulation/Simulation.kt (82), core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt (43), core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt (37). Each one tells the compiler to trust the author about null and becomes a `NullPointerException` the first time the author is wrong. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
Replace `!!` rather than adding to it: each is a run-time null check the compiler could not prove. Narrow the value with a null check, an early return or `?: return`, use `?.` / `?:` where absence is legitimate, `requireNotNull(x) { "why" }` / `checkNotNull` where a missing value is a contract breach worth a message, make the property non-nullable and set it in the constructor (or `by lazy`) instead of `lateinit` plus `!!`, or change the API so the null cannot arrive.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 62 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no public interfaces
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — validating docker-compose.yml: services.unciv.volumes must be a list; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named column (email, first_name, date_of_birth, phone_number, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~18854 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D12 Dependency Hygiene — Not scored — a Gradle build resolved 300 artifact(s) across its subprojects (188 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .java, .kt source were not judged.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
D32 Data Compliance (PII/GDPR) — 51 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (140 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 46 current-state document(s) make no claim of a kind M4 checks. 12 claim(s) of kinds M4 does not check were not checked (path 2, command argument 6, environment variable 4); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R4 Test Coverage — the JS/TS workspace (7 production file(s)) has no JavaScript/TypeScript test, but it is 0.58% of this repository's production source and the other 99.42% carries 18,854 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Orphaned knowledge core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
X1 · Async correctness· `runBlocking` inside a coroutine · ×1
`runBlocking` inside a coroutine core/src/com/unciv/logic/github/Github.kt:133— `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
TodoComment tests/src/com/unciv/ui/screens/devconsole/DevConsoleTests.kt:38— //TODO Autocompletion unit test - DevConsolePopup is too tightly integrated with WorldScreen at the moment to allow that. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/src/com/unciv/logic/TranslationTests.kt:495— //todo This test was designed before the Bangla language was merged, and uses its own data. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/src/com/unciv/logic/filter/CityCivFilterTests.kt:88— // TODO: Bug: cities aren't given a city context for filtering — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/com/unciv/app/server/UncivServer.kt:246— // TODO Check if the user is the current player and validate its password this requires decoding the game file — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/Constants.kt:33— // TODO: GameStarter places "Tundra" startBias first. Can we make it generic by checking count by terrain? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/Constants.kt:43— // TODO this is very opaque behaviour to modders — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/view/CityView.kt:185— // TODO Citystats being stateful breaks the "stateless" ideal of View API, think about this :/ — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/view/CityView.kt:191— // TODO Citystats being stateful breaks the "stateless" ideal of View API, think about this :/ — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/view/CivView.kt:43— // TODO Compare with getCivResourcesByName for overlap/conflict — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/view/TileView.kt:161— // TODO: replace with multi-target AStar — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/worldscreen/RenderEvent.kt:42— //todo check generated translations — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:190— // Todo: valid tiles for actions should be handled internally, not here. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/victoryscreen/VictoryScreenIllustrations.kt:28— // todo Idea: use victoryCompletePercent to allow "percentage" images - e.g. "Destroy all players" now works all or nothing - boring. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/victoryscreen/VictoryScreenIllustrations.kt:110— // todo measure: 265f = PickerPane.bottomTable.height + SplitPane.handle.height + 2* TabbedPager.header.height + separator.height — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/savescreens/QuickSave.kt:15— //todo reduce code duplication — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/savescreens/VerticalFileListScrollPane.kt:20— //todo key auto-repeat for navigation keys? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:194— // TODO should be a skin ButtonStyle, this mixes with the style override from disable() below - which is a very wrong approach anyway — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/pickerscreens/PolicyPickerScreen.kt:196— // TODO If we'd want to use scene2d correctly, this is supposed to happen inside an overridden layout() method — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/pickerscreens/PolicyPickerScreen.kt:415— //todo resolve kludge by making BranchHeader a proper class — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTab.kt:45— // todo Kludge! Positioning and alignment of the header Table within its parent has quirks when content width < stage width — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTab.kt:77— // todo Kludge! Positioning and alignment of the header Table within its parent has quirks when content width < stage width — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTab.kt:44— //todo The original did its own sort: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTab.kt:60— //todo the comments and todo below are copied verbatim from CityOverviewTab - synergies? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTabColumn.kt:25— //todo Extending getEntryValue here to have a second String-based "channel" - could go into SortableGrid, possibly by defining a DataType per column??? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTabColumn.kt:92— //todo these overrides call a getTilesInDistance(3).firstOrNull loop independently and possibly repeatedly - caching? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Hotspot: core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:79— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 331 in UniqueTriggerActivation.getTriggerFunction at line 79. 2 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt:61— core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in WorldMapTileUpdater.updateTilesForSelectedUnit at line 61. 2 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/UnitAutomation.kt core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:53— core/src/com/unciv/logic/automation/unit/UnitAutomation.kt changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in UnitAutomation.automateUnitMoves at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/UnitAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt:23— core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in CivilianUnitAutomation.automateCivilianUnit at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:166— core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in WorldMapHolder.onTileClicked at line 166. 6 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt:113— core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in SpecificUnitAutomation.automateSettlerActions at line 113. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:180— core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in BattleTable.simulateBattle at line 180. 2 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:513— core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in WorkerAutomation.getImprovementRanking at line 513. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt:419— core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in WorldScreen.update at line 419. 2 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/map/mapunit/MapUnit.kt core/src/com/unciv/logic/map/mapunit/MapUnit.kt:535— core/src/com/unciv/logic/map/mapunit/MapUnit.kt changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in MapUnit.healingAmountForTile at line 535. 6 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/map/mapunit/MapUnit.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:500— core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in UnitMovement.moveToTile at line 500. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:636— core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in NextTurnAutomation.trainSettler at line 636. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt:211— core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in UnitTable.tileSelected at line 211. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/models/ruleset/unique/Conditionals.kt core/src/com/unciv/models/ruleset/unique/Conditionals.kt:28— core/src/com/unciv/models/ruleset/unique/Conditionals.kt changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in Conditionals.conditionalApplies at line 28. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/models/ruleset/unique/Conditionals.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/civilization/managers/TurnManager.kt core/src/com/unciv/logic/civilization/managers/TurnManager.kt:29— core/src/com/unciv/logic/civilization/managers/TurnManager.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in TurnManager.startTurn at line 29. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/civilization/managers/TurnManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:125— core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ImprovementPickerScreen.addImprovementRow at line 125. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/GameInfo.kt core/src/com/unciv/logic/GameInfo.kt:384— core/src/com/unciv/logic/GameInfo.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in GameInfo.nextTurn at line 384. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/GameInfo.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/models/ruleset/Victory.kt core/src/com/unciv/models/ruleset/Victory.kt:277— core/src/com/unciv/models/ruleset/Victory.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in Milestone.getVictoryScreenButtons at line 277. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/models/ruleset/Victory.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt:129— core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in RoadBetweenCitiesAutomation.getRoadsToBuildFromCity at line 129. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt:58— core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in UnitActionsTable.update at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt:21— core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AirUnitAutomation.automateFighter at line 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:399— core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DiplomacyAutomation.offerPeaceTreaty at line 399. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:31— core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in MotivationToAttackAutomation.hasAtLeastMotivationToAttack at line 31. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/ui/objectdescriptions/TileDescription.kt core/src/com/unciv/ui/objectdescriptions/TileDescription.kt:23— core/src/com/unciv/ui/objectdescriptions/TileDescription.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in TileDescription.toMarkup at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/objectdescriptions/TileDescription.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/com/unciv/logic/automation/Automation.kt core/src/com/unciv/logic/automation/Automation.kt:199— core/src/com/unciv/logic/automation/Automation.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Automation.chooseMilitaryUnit at line 199. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/logic/automation/Automation.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
TooManyMethods: Civilization core/src/com/unciv/logic/civilization/Civilization.kt:60— TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Tile core/src/com/unciv/logic/map/tile/Tile.kt:42— TooManyMethods — 117 methods. The bar is 30 methods; this is 87 over it, 3.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MapUnit core/src/com/unciv/logic/map/mapunit/MapUnit.kt:41— TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: City core/src/com/unciv/logic/city/City.kt:51— TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CityView core/src/com/unciv/view/CityView.kt:32— TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MapUnitView core/src/com/unciv/view/MapUnitView.kt:34— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CityConstructions core/src/com/unciv/logic/city/CityConstructions.kt:55— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CivView core/src/com/unciv/view/CivView.kt:25— TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DiplomacyManager core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:164— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TileView core/src/com/unciv/view/TileView.kt:29— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TextureArraySpriteBatch core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:47— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BaseUnit core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:39— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RulesetValidator core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:66— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ImageGetter core/src/com/unciv/ui/images/ImageGetter.kt:41— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QuestManager core/src/com/unciv/logic/civilization/managers/quests/QuestManager.kt:26— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TileMap core/src/com/unciv/logic/map/TileMap.kt:34— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MusicController core/src/com/unciv/ui/audio/MusicController.kt:28— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ForeignCityView core/src/com/unciv/view/ForeignCityView.kt:16— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GameInfo core/src/com/unciv/logic/GameInfo.kt:100— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GameOptionsTable core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt:42— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LongPriorityQueue core/src/com/unciv/utils/LongPriorityQueue.kt:19— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CityStateFunctions core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:28— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReligionManager core/src/com/unciv/logic/civilization/managers/ReligionManager.kt:25— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TechManager core/src/com/unciv/logic/civilization/managers/TechManager.kt:28— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TabbedPager core/src/com/unciv/ui/components/widgets/TabbedPager.kt:68— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Swallowed exception (caught, then discarded) server/src/com/unciv/app/server/UncivServer.kt:155— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) server/src/com/unciv/app/server/UncivServer.kt:300— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) desktop/src/com/unciv/app/desktop/DesktopGame.kt:62— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) desktop/src/com/unciv/app/desktop/SystemUtils.kt:52— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) desktop/src/com/unciv/app/desktop/SystemUtils.kt:58— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) desktop/src/com/unciv/app/desktop/SystemUtils.kt:93— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) desktop/src/com/unciv/app/desktop/SystemUtils.kt:113— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/utils/StringExtensions.kt:13— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/savescreens/LoadOrSaveScreen.kt:143— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/savescreens/LoadOrSaveScreen.kt:179— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/savescreens/LoadOrSaveScreen.kt:214— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:199— `catch (ex: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:298— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/UncivKtor.kt:32— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/multiplayer/Multiplayer.kt:68— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/map/TileMap.kt:552— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:27— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/github/Github.kt:150— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/files/MapSaver.kt:19— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) core/src/com/unciv/logic/files/UncivFiles.kt:439— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) android/src/com/unciv/app/AndroidLogBackend.kt:87— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) android/src/com/unciv/app/AndroidLogBackend.kt:99— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) android/src/com/unciv/app/AndroidLogBackend.kt:105— `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
FileTooLong: unique/UniqueTriggerActivation.kt core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt— FileTooLong — 1062 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 562 over it, 2.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: basescreen/TextureArraySpriteBatch.java core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java— FileTooLong — 933 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: TextureArraySpriteBatch (47-1473). The bar is 500 significant lines; this is 433 over it, 1.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: civilization/Civilization.kt core/src/com/unciv/logic/civilization/Civilization.kt— FileTooLong — 864 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: Civilization (60-1329). The bar is 500 significant lines; this is 364 over it, 1.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: unique/UniqueType.kt core/src/com/unciv/models/ruleset/unique/UniqueType.kt— FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: class (28-1222). The bar is 500 significant lines; this is 347 over it, 1.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: tile/Tile.kt core/src/com/unciv/logic/map/tile/Tile.kt— FileTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Tile (42-1282). The bar is 500 significant lines; this is 339 over it, 1.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: mapunit/MapUnit.kt core/src/com/unciv/logic/map/mapunit/MapUnit.kt— FileTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: MapUnit (41-1247). The bar is 500 significant lines; this is 274 over it, 1.55× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: city/CityConstructions.kt core/src/com/unciv/logic/city/CityConstructions.kt— FileTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CityConstructions (55-1159). The bar is 500 significant lines; this is 191 over it, 1.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: movement/UnitMovement.kt core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt— FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: UnitMovement (48-1011). The bar is 500 significant lines; this is 124 over it, 1.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: diplomacy/CityStateFunctions.kt core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt— FileTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: CityStateFunctions (28-922). The bar is 500 significant lines; this is 100 over it, 1.20× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: validation/RulesetValidator.kt core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt— FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: RulesetValidator (66-910). The bar is 500 significant lines; this is 97 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: diplomacy/DiplomacyManager.kt core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt— FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: DiplomacyManager (164-984). The bar is 500 significant lines; this is 93 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: translations/TranslationFileWriter.kt core/src/com/unciv/models/translations/TranslationFileWriter.kt— FileTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 69 over it, 1.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: worldscreen/WorldScreen.kt core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt— FileTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: WorldScreen (120-861). The bar is 500 significant lines; this is 68 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: battle/Battle.kt core/src/com/unciv/logic/battle/Battle.kt— FileTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 67 over it, 1.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cityscreen/CityConstructionsTable.kt core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt— FileTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: CityConstructionsTable (69-824). The bar is 500 significant lines; this is 57 over it, 1.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: city/City.kt core/src/com/unciv/logic/city/City.kt— FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: City (51-797). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: mapgenerator/MapGenerator.kt core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt— FileTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: MapGenerator (45-826). The bar is 500 significant lines; this is 34 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: newgamescreen/GameOptionsTable.kt core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt— FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: GameOptionsTable (42-620). The bar is 500 significant lines; this is 29 over it, 1.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: logic/GameInfo.kt core/src/com/unciv/logic/GameInfo.kt— FileTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: GameInfo (100-885). The bar is 500 significant lines; this is 23 over it, 1.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: ruleset/Ruleset.kt core/src/com/unciv/models/ruleset/Ruleset.kt— FileTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: Ruleset (106-768). The bar is 500 significant lines; this is 22 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: map/TileMap.kt core/src/com/unciv/logic/map/TileMap.kt— FileTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: TileMap (34-932). The bar is 500 significant lines; this is 13 over it, 1.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: civilization/NextTurnAutomation.kt core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt— FileTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 12 over it, 1.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
ClassTooLong: TextureArraySpriteBatch core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:47— ClassTooLong — 918 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 518 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Tile core/src/com/unciv/logic/map/tile/Tile.kt:42— ClassTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded), 117 methods. The bar is 400 significant lines; this is 400 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Civilization core/src/com/unciv/logic/civilization/Civilization.kt:60— ClassTooLong — 781 significant lines (blank, comment-only and punctuation-only lines excluded), 119 methods. The bar is 400 significant lines; this is 381 over it, 1.95× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MapUnit core/src/com/unciv/logic/map/mapunit/MapUnit.kt:41— ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 106 methods. The bar is 400 significant lines; this is 340 over it, 1.85× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CityConstructions core/src/com/unciv/logic/city/CityConstructions.kt:55— ClassTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 247 over it, 1.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CityStateFunctions core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:28— ClassTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 176 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UnitMovement core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:48— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 163 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RulesetValidator core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:66— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 155 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MapGenerator core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:45— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 100 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CityConstructionsTable core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt:69— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 98 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: City core/src/com/unciv/logic/city/City.kt:51— ClassTooLong — 496 significant lines (blank, comment-only and punctuation-only lines excluded), 94 methods. The bar is 400 significant lines; this is 96 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TileMap core/src/com/unciv/logic/map/TileMap.kt:34— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 89 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WorldScreen core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt:120— ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 70 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DiplomacyManager core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:164— ClassTooLong — 455 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 55 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AlertPopup core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt:62— ClassTooLong — 455 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 55 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GameInfo core/src/com/unciv/logic/GameInfo.kt:100— ClassTooLong — 441 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 41 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Ruleset core/src/com/unciv/models/ruleset/Ruleset.kt:106— ClassTooLong — 436 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 36 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WorldMapHolder core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:52— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModManagementScreen core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt:69— ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GameStarter core/src/com/unciv/logic/GameStarter.kt:36— ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 11 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GameOptionsTable core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt:42— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 2 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×8
Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:406— core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:406-414 | core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:422-430 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/models/ruleset/IConstruction.kt:144— core/src/com/unciv/models/ruleset/IConstruction.kt:144-152 | core/src/com/unciv/models/ruleset/tile/TileImprovement.kt:186-194 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/models/ruleset/unique/Countables.kt:194— core/src/com/unciv/models/ruleset/unique/Countables.kt:194-204 | core/src/com/unciv/models/ruleset/unique/Countables.kt:238-246 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:113— core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:113-121 | core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:127-135 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:174— core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:174-182 | core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:207-216 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:123— core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:123-131 | core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:137-145 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:163— core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:163-171 | core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:173-181 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:70— core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:70-79 | core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorWesnothImporter.kt:73-81 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:368— core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:368-376 | core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:378-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/simulation/Simulation.kt:270— core/src/com/unciv/logic/simulation/Simulation.kt:270-278 | core/src/com/unciv/logic/simulation/Simulation.kt:280-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/simulation/Simulation.kt:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) core/src/com/unciv/models/ruleset/Belief.kt:27— core/src/com/unciv/models/ruleset/Belief.kt:27-35 | core/src/com/unciv/models/ruleset/tech/Technology.kt:47-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) core/src/com/unciv/models/ruleset/nation/Nation.kt:167— core/src/com/unciv/models/ruleset/nation/Nation.kt:167-175 | core/src/com/unciv/models/ruleset/tile/TileImprovement.kt:87-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:287— core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:287-295 | core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:302-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:97— core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:97-105 | core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:158-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/map/AStar.kt:151— core/src/com/unciv/logic/map/AStar.kt:151-159 | core/src/com/unciv/logic/map/BFS.kt:75-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:395— core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:395-403 | core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:426-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:395` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×7
Edited copy of a member (13 corresponding lines) android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt:95— android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt:95-107 | android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt:116-128 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/cityscreen/SpecialistAllocationTable.kt:82— core/src/com/unciv/ui/screens/cityscreen/SpecialistAllocationTable.kt:82-95 | core/src/com/unciv/ui/screens/cityscreen/SpecialistAllocationTable.kt:97-109 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/civilization/Civilization.kt:1074— core/src/com/unciv/logic/civilization/Civilization.kt:1074-1086 | core/src/com/unciv/logic/civilization/Civilization.kt:1088-1102 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:252— core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:252-270 | core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:273-285 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:212— core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:212-224 | core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:226-243 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/Perlin.kt:44— core/src/com/unciv/logic/map/mapgenerator/Perlin.kt:44-56 | core/src/com/unciv/logic/map/mapgenerator/Perlin.kt:62-79 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt:174— core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt:174-186 | core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt:188-200 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 2) core/src/com/unciv/logic/battle/Battle.kt:259— core/src/com/unciv/logic/battle/Battle.kt:259-265 | core/src/com/unciv/logic/battle/Battle.kt:268-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/src/com/unciv/logic/civilization/Civilization.kt:1075— core/src/com/unciv/logic/civilization/Civilization.kt:1075-1081 | core/src/com/unciv/logic/civilization/Civilization.kt:1090-1096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/civilization/Civilization.kt:1075` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/com/unciv/logic/civilization/Civilization.kt:1097` calls `addHappiness` and `core/src/com/unciv/logic/civilization/Civilization.kt:1082` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) core/src/com/unciv/logic/civilization/managers/PolicyManager.kt:267— core/src/com/unciv/logic/civilization/managers/PolicyManager.kt:267-273 | core/src/com/unciv/logic/civilization/managers/TechManager.kt:330-336 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) core/src/com/unciv/models/ruleset/Policy.kt:107— core/src/com/unciv/models/ruleset/Policy.kt:107-113 | core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:271-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/Policy.kt:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:277— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:277-283 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:311-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) core/src/com/unciv/logic/civilization/Civilization.kt:1305— core/src/com/unciv/logic/civilization/Civilization.kt:1305-1312 | core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsOverviewTable.kt:328-334 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:93— core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:93-99 | core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:103-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
MethodTooLong: UncivServerRunner.serverRun server/src/com/unciv/app/server/UncivServer.kt:281— MethodTooLong — serverRun runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Ruleset.load core/src/com/unciv/models/ruleset/Ruleset.kt:484— MethodTooLong — load runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TradeLogic.acceptTrade core/src/com/unciv/logic/trade/TradeLogic.kt:115— MethodTooLong — acceptTrade runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MapRegions.assignRegions core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:237— MethodTooLong — assignRegions runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TextureArraySpriteBatch.draw core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:954— MethodTooLong — draw runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BattleTable.simulateBattle core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:180— MethodTooLong — simulateBattle runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Change coupling: Conditionals.kt ↔ UniqueType.kt core/src/com/unciv/models/ruleset/unique/Conditionals.kt:1— `core/src/com/unciv/models/ruleset/unique/Conditionals.kt` and `core/src/com/unciv/models/ruleset/unique/UniqueType.kt` change together 67% of the time (41 of the 61 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 41 shared commits counted here, the most recent 3 are `e326a871` Add conditionals for current unit movement (#14695); `686060b1` Carrying conditional and countable (#14369); `0c298dae` Fix `<on [difficulty] or higher/lower>` Conditional (#14236) — run `git show` on any of them.
Change coupling: BuildConfig.kt ↔ UncivGame.kt buildSrc/src/main/kotlin/BuildConfig.kt:1— `buildSrc/src/main/kotlin/BuildConfig.kt` and `core/src/com/unciv/UncivGame.kt` change together 63% of the time (426 of the 673 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 426 shared commits counted here, the most recent 3 are `f9ba686b` Version rollout (#15995); `55a9a072` Version rollout (#15981); `9b5d128c` Version rollout (#15966) — run `git show` on any of them.
Change coupling: NextTurnAutomation.kt ↔ Trade.kt core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:1— `core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt` and `core/src/com/unciv/logic/trade/Trade.kt` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0ddbb46c` Implementation for establishing embassies in diplomacy (#13625); `700e2416` AI Open Borders Offer fix (#10178); `cc162460` AI diplomatic actions rework (#10071) — run `git show` on any of them.
Change coupling: CityConstructions.kt ↔ CityScreenConstructionMenu.kt core/src/com/unciv/logic/city/CityConstructions.kt:1— `core/src/com/unciv/logic/city/CityConstructions.kt` and `core/src/com/unciv/ui/popups/CityScreenConstructionMenu.kt` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c4cec5dc` Construction queue: MaxNumberBuildable counting and thread-safe queue…; `eb511576` chore: Refactor PerpetualConstruction (#15089); `cd22be00` Partially fix #13831 - city construction menu cannot add improvement-… — run `git show` on any of them.
Change coupling: OverlayButtonData.kt ↔ WorldMapTileUpdater.kt core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt:1— `core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt` and `core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `007d1cb3` View implementation - RoadToAutomation - see #15280; `f0791d7f` View implementation - wander() conversion, minimize MapUnitView essen…; `feb5e606` Revert "fix:Refactor movement logic for hidden unit handling (#15547)… — run `git show` on any of them.
Change coupling: Github.kt ↔ ModInfoAndActionPane.kt core/src/com/unciv/logic/github/Github.kt:1— `core/src/com/unciv/logic/github/Github.kt` and `core/src/com/unciv/ui/screens/modmanager/ModInfoAndActionPane.kt` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c31823c4` Streamed extracting while downloading mods (#14261); `8da4987b` Mod downloading tweaks and fixes (#14114); `2e2ceb99` Fix selecting local mods without preview won't display an avatar (#14… — run `git show` on any of them.
Duplicated block (5 lines × 2) core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:51— core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:51-55 | core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:80-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) core/src/com/unciv/models/ruleset/unique/Countables.kt:195— core/src/com/unciv/models/ruleset/unique/Countables.kt:195-199 | core/src/com/unciv/models/ruleset/unique/Countables.kt:239-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/Countables.kt:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) core/src/com/unciv/models/ruleset/Policy.kt:42— core/src/com/unciv/models/ruleset/Policy.kt:42-46 | core/src/com/unciv/models/ruleset/tile/TileResource.kt:129-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) core/src/com/unciv/logic/city/City.kt:413— core/src/com/unciv/logic/city/City.kt:413-417 | core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:657-661 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `flag` to `CityFlags` in one and `DiplomacyFlags` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:664` calls `getFlag` and `core/src/com/unciv/logic/city/City.kt:419` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) core/src/com/unciv/models/ruleset/Policy.kt:129— core/src/com/unciv/models/ruleset/Policy.kt:129-133 | core/src/com/unciv/models/ruleset/Policy.kt:155-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/Policy.kt:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/MapRegionResources.kt:59— core/src/com/unciv/logic/map/mapgenerator/resourceplacement/MapRegionResources.kt:59-63 | core/src/com/unciv/logic/map/mapgenerator/resourceplacement/MapRegionResources.kt:76-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Swallowed exception (empty catch) desktop/src/com/unciv/app/desktop/DesktopLauncher.kt:159— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) core/src/com/unciv/ui/screens/newgamescreen/MapFileSelectTable.kt:327— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) core/src/com/unciv/ui/components/fonts/FontRulesetIcons.kt:109— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) core/src/com/unciv/ui/components/fonts/FontRulesetIcons.kt:110— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) core/src/com/unciv/ui/audio/MusicTrackController.kt:159— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) android/src/com/unciv/app/AndroidLauncher.kt:116— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×5
Edited copy of a member (15 corresponding lines) core/src/com/unciv/logic/civilization/Civilization.kt:663— core/src/com/unciv/logic/civilization/Civilization.kt:663-677 | core/src/com/unciv/logic/civilization/Civilization.kt:687-703 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt:240— core/src/com/unciv/models/ruleset/Building.kt:240-255 | core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt:78-92 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:81— core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:81-95 | core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorWesnothImporter.kt:83-104 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) core/src/com/unciv/ui/objectdescriptions/DescriptionHelpers.kt:43— core/src/com/unciv/ui/objectdescriptions/DescriptionHelpers.kt:43-58 | core/src/com/unciv/ui/objectdescriptions/FormattedLineListBuilder.kt:247-261 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) android/src/com/unciv/app/AndroidSaverLoader.kt:35— android/src/com/unciv/app/AndroidSaverLoader.kt:35-53 | android/src/com/unciv/app/AndroidSaverLoader.kt:58-72 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) core/src/com/unciv/ui/popups/options/OptionsPopupHelpers.kt:127— core/src/com/unciv/ui/popups/options/OptionsPopupHelpers.kt:127-142 | core/src/com/unciv/ui/popups/options/OptionsPopupHelpers.kt:153-163 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/civilization/CivConstructions.kt:107— core/src/com/unciv/logic/civilization/CivConstructions.kt:107-117 | core/src/com/unciv/logic/civilization/CivConstructions.kt:131-141 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/civilization/CivConstructions.kt:119— core/src/com/unciv/logic/civilization/CivConstructions.kt:119-129 | core/src/com/unciv/logic/civilization/CivConstructions.kt:143-153 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:13— core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:13-24 | core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:42-52 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt:184— core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt:184-194 | core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt:239-250 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Outbound HTTP without resilience core/src/com/unciv/logic/multiplayer/chat/ChatWebSocket.kt:97— `HttpClient {` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience core/src/com/unciv/logic/multiplayer/storage/DropBox.kt:28— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience web/validation/desktop-network-contract/src/main/kotlin/com/unciv/logic/multiplayer/apiv2/Main.kt:26— `HttpClient {` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience web/validation/http-fetch-engine/browser-fetch-contract.cjs:82— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience web/validation/http-fetch-engine/browser-fetch-contract.cjs:100— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×4
Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/screens/worldscreen/status/AutoPlayMenu.kt:67— core/src/com/unciv/ui/screens/worldscreen/status/AutoPlayMenu.kt:67-85 | core/src/com/unciv/ui/screens/worldscreen/status/AutoPlayMenu.kt:87-104 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:149— core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:149-166 | core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:644-665 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt:208— core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt:208-225 | core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt:227-244 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:225— core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:225-242 | core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:245-262 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Boundary violation [package:relative-cross-package] REDACTED:8— REDACTED:8 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead.
Boundary violation [package:relative-cross-package] web/validation/http-fetch-engine/browser-fetch-contract.cjs:5— web/validation/http-fetch-engine/browser-fetch-contract.cjs:5 reaches into another package with a relative path (../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead.
Boundary violation [package:relative-cross-package] REDACTED:9— REDACTED:9 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead.
Boundary violation [package:relative-cross-package] REDACTED:9— REDACTED:9 reaches into another package with a relative path (./../../build/validation/headless-browser/node_modules/playwright) — import the package by name instead.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×3
Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:682— core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:682-713 | core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:834-857 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:716— core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:716-739 | core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:766-791 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:741— core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:741-764 | core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:793-816 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) core/src/com/unciv/logic/automation/civilization/ThreatManager.kt:135— core/src/com/unciv/logic/automation/civilization/ThreatManager.kt:135-151 | core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:435-451 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) core/src/com/unciv/ui/images/ImageGetter.kt:420— core/src/com/unciv/ui/images/ImageGetter.kt:420-437 | core/src/com/unciv/ui/images/ImageGetter.kt:439-455 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:387— core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:387-403 | core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:440-462 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×3
Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/map/mapunit/MapUnit.kt:377— core/src/com/unciv/logic/map/mapunit/MapUnit.kt:377-384 | core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:499-505 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/battle/MapUnitCombatant.kt:38— core/src/com/unciv/logic/battle/MapUnitCombatant.kt:38-44 | core/src/com/unciv/logic/battle/Battle.kt:875-882 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:346— core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:346-353 | core/src/com/unciv/logic/GameStarter.kt:158-164 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 3) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:292— core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:292-298 | core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:301-307 | core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:310-316 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:50— core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:50-56 | core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:64-70 | core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:78-84 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:55— core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:55-63 | core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:83-89 | core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:103-111 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:101` calls `getResourceRequirementsPerTurn`, `containsKey` and `core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:54` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) core/src/com/unciv/logic/battle/Battle.kt:448— core/src/com/unciv/logic/battle/Battle.kt:448-453 | core/src/com/unciv/logic/battle/Battle.kt:457-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/battle/Battle.kt:448` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:641— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:641-646 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:661-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:641` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) core/src/com/unciv/ui/components/widgets/BorderedTable.kt:43— core/src/com/unciv/ui/components/widgets/BorderedTable.kt:43-48 | core/src/com/unciv/ui/components/widgets/BorderedTable.kt:50-55 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Low cohesion: ModConstants (LCOM4 4) core/src/com/unciv/models/ModConstants.kt:18— ModConstants's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CrashScreen (LCOM4 4) core/src/com/unciv/ui/crashhandling/CrashScreen.kt:29— CrashScreen's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DiplomacyScreen (LCOM4 4) core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt:51— DiplomacyScreen's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Sync-over-async blocking core/src/com/unciv/logic/github/Github.kt:125— `getPreviewImageOrNull` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
Sync-over-async blocking core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:340— `awaitPing` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
Sync-over-async blocking web/validation/http-fetch-engine/browser-fetch-contract.cjs:24— `zlib.gzipSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
FunctionTooLong: run-game.main REDACTED:17— FunctionTooLong — main runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: browser-fetch-contract.main web/validation/http-fetch-engine/browser-fetch-contract.cjs:22— FunctionTooLong — main runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt:194— core/src/com/unciv/models/ruleset/Building.kt:194-231 | core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt:96-133 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) core/src/com/unciv/logic/multiplayer/Multiplayer.kt:151— core/src/com/unciv/logic/multiplayer/Multiplayer.kt:151-188 | core/src/com/unciv/logic/multiplayer/Multiplayer.kt:197-236 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:285— core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:285-299 | core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:301-314 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) core/src/com/unciv/utils/LongPriorityQueue.kt:103— core/src/com/unciv/utils/LongPriorityQueue.kt:103-116 | core/src/com/unciv/utils/LongPriorityQueue.kt:118-132 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt:91— core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt:91-113 | core/src/com/unciv/ui/screens/worldscreen/worldmap/OverlayButtonData.kt:122-140 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:54— core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:54-72 | core/src/com/unciv/logic/multiplayer/storage/UncivServerFileStorage.kt:89-107 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×2
Edited copy of a member (8 corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:101— core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:101-108 | core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:110-119 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorFilesScroll.kt:68— core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorFilesScroll.kt:68-76 | core/src/com/unciv/ui/screens/newgamescreen/MapFileSelectTable.kt:115-122 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (16 lines × 2) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:67— core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:67-82 | core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:334-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) core/src/com/unciv/logic/map/MapPathing.kt:90— core/src/com/unciv/logic/map/MapPathing.kt:90-105 | core/src/com/unciv/logic/map/MapPathing.kt:124-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/map/MapPathing.kt:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:548— core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:548-562 | core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:572-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:548` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:859— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:859-873 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:878-892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:859` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) core/src/com/unciv/models/ruleset/Building.kt:456— core/src/com/unciv/models/ruleset/Building.kt:456-467 | core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:332-343 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/Building.kt:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:60— core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:60-71 | core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:87-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:158— core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:158-165 | core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:654-661 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:358— core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:358-365 | core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:427-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorLoadTab.kt:68— core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorLoadTab.kt:68-78 | core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorSaveTab.kt:95-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:797— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:797-807 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:917-927 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 9) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:519— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:519-525 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:579-585 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:627-633 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:671-677 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:724-730 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:805-811 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:925-931 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1061-1067 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1117-1123 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 9) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:539— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:539-545 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:599-605 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:647-653 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:691-697 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:744-750 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:825-831 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:945-951 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1081-1087 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1137-1143 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:539` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2 locations) REDACTED:83— REDACTED:83 · REDACTED:145 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) REDACTED:173— REDACTED:173 · REDACTED:137 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
UniqueTriggerActivation.getTriggerFunction (cyclomatic 331) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:79— UniqueTriggerActivation.getTriggerFunction has cyclomatic complexity 331 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Conditionals.conditionalApplies (cyclomatic 162) core/src/com/unciv/models/ruleset/unique/Conditionals.kt:28— Conditionals.conditionalApplies has cyclomatic complexity 162 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Building.getRejectionReasons (cyclomatic 62) core/src/com/unciv/models/ruleset/Building.kt:280— Building.getRejectionReasons has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Ruleset.load (cyclomatic 53) core/src/com/unciv/models/ruleset/Ruleset.kt:484— Ruleset.load has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Milestone.getVictoryScreenButtons (cyclomatic 50) core/src/com/unciv/models/ruleset/Victory.kt:277— Milestone.getVictoryScreenButtons has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TradeEvaluation.evaluateSellCost (cyclomatic 48) core/src/com/unciv/logic/trade/TradeEvaluation.kt:370— TradeEvaluation.evaluateSellCost has cyclomatic complexity 48 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WorldMapTileUpdater.updateTilesForSelectedUnit (cyclomatic 47) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt:61— WorldMapTileUpdater.updateTilesForSelectedUnit has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
City.matchesSingleFilter (cyclomatic 44) core/src/com/unciv/logic/city/City.kt:570— City.matchesSingleFilter has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CivilianUnitAutomation.automateCivilianUnit (cyclomatic 43) core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt:23— CivilianUnitAutomation.automateCivilianUnit has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TradeLogic.acceptTrade (cyclomatic 41) core/src/com/unciv/logic/trade/TradeLogic.kt:115— TradeLogic.acceptTrade has cyclomatic complexity 41 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
UnitAutomation.automateUnitMoves (cyclomatic 39) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:53— UnitAutomation.automateUnitMoves has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity· main (cyclomatic 39) · ×1
main (cyclomatic 39) web/validation/http-fetch-engine/browser-fetch-contract.cjs:22— main has cyclomatic complexity 39 (threshold 15). Of this number, 26 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TileImprovementFunctions.canImprovementBeBuiltHere (cyclomatic 38) core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt:140— TileImprovementFunctions.canImprovementBeBuiltHere has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TradeEvaluation.evaluateBuyCost (cyclomatic 38) core/src/com/unciv/logic/trade/TradeEvaluation.kt:165— TradeEvaluation.evaluateBuyCost has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpecificUnitAutomation.automateSettlerActions (cyclomatic 37) core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt:113— SpecificUnitAutomation.automateSettlerActions has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Tile.matchesSingleTerrainFilter (cyclomatic 37) core/src/com/unciv/logic/map/tile/Tile.kt:572— Tile.matchesSingleTerrainFilter has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
OffersListScroll.update (cyclomatic 37) core/src/com/unciv/ui/screens/diplomacyscreen/OffersListScroll.kt:48— OffersListScroll.update has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReligionAutomation.beliefBonusForPlayer (cyclomatic 34) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:326— ReligionAutomation.beliefBonusForPlayer has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MovementCost.getMovementCostBetweenAdjacentTiles (cyclomatic 34) core/src/com/unciv/logic/map/mapunit/movement/MovementCost.kt:40— MovementCost.getMovementCostBetweenAdjacentTiles has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UncivServerRunner.serverRun (cyclomatic 34) server/src/com/unciv/app/server/UncivServer.kt:281— UncivServerRunner.serverRun has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BaseUnit.getRejectionReasons (cyclomatic 33) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:233— BaseUnit.getRejectionReasons has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitMovement.cannotPassThroughReason (cyclomatic 32) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:884— UnitMovement.cannotPassThroughReason has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BaseUnitDescriptions.getBaseUnitCivilopediaTextLines (cyclomatic 32) core/src/com/unciv/ui/objectdescriptions/BaseUnitDescriptions.kt:87— BaseUnitDescriptions.getBaseUnitCivilopediaTextLines has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TradeAutomation.getCounteroffer (cyclomatic 31) core/src/com/unciv/logic/automation/civilization/TradeAutomation.kt:55— TradeAutomation.getCounteroffer has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileDescription.toMarkup (cyclomatic 31) core/src/com/unciv/ui/objectdescriptions/TileDescription.kt:23— TileDescription.toMarkup has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CityStateFunctions.getTributeModifiers (cyclomatic 30) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:487— CityStateFunctions.getTributeModifiers has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UnitMovement.moveToTile (cyclomatic 30) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:500— UnitMovement.moveToTile has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BattleTable.simulateBattle (cyclomatic 30) core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:180— BattleTable.simulateBattle has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildingDescriptions.getBuildingCivilopediaTextLines (cyclomatic 29) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:168— BuildingDescriptions.getBuildingCivilopediaTextLines has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkerAutomation.getImprovementRanking (cyclomatic 28) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:513— WorkerAutomation.getImprovementRanking has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitActionsTable.update (cyclomatic 28) core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt:58— UnitActionsTable.update has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MotivationToAttackAutomation.hasAtLeastMotivationToAttack (cyclomatic 27) core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:31— MotivationToAttackAutomation.hasAtLeastMotivationToAttack has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DiplomacyTurnManager.nextTurnFlags (cyclomatic 27) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:150— DiplomacyTurnManager.nextTurnFlags has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitMovement.getShortestPath (cyclomatic 27) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:155— UnitMovement.getShortestPath has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PromotionTree.update (cyclomatic 27) core/src/com/unciv/ui/screens/pickerscreens/PromotionTree.kt:72— PromotionTree.update has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameInfo.nextTurn (cyclomatic 26) core/src/com/unciv/logic/GameInfo.kt:384— GameInfo.nextTurn has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StartNormalizer.calculateFoodBonusesNeeded (cyclomatic 26) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:175— StartNormalizer.calculateFoodBonusesNeeded has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TileStatFunctions.getTileStatsBreakdown (cyclomatic 26) core/src/com/unciv/logic/map/tile/TileStatFunctions.kt:57— TileStatFunctions.getTileStatsBreakdown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkerAutomation.chooseImprovement (cyclomatic 25) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:422— WorkerAutomation.chooseImprovement has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BuildingDescriptions.getDescription (cyclomatic 25) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:48— BuildingDescriptions.getDescription has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitTable.tileSelected (cyclomatic 25) core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt:211— UnitTable.tileSelected has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TurnManager.startTurn (cyclomatic 24) core/src/com/unciv/logic/civilization/managers/TurnManager.kt:29— TurnManager.startTurn has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TradeLogic.getAvailableOffers (cyclomatic 24) core/src/com/unciv/logic/trade/TradeLogic.kt:39— TradeLogic.getAvailableOffers has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Milestone.getVictoryScreenButtonHeaderText (cyclomatic 24) core/src/com/unciv/models/ruleset/Victory.kt:202— Milestone.getVictoryScreenButtonHeaderText has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BaseRulesetValidator.checkUnit (cyclomatic 24) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:489— BaseRulesetValidator.checkUnit has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileLayerBorders.updateBorders (cyclomatic 24) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerBorders.kt:34— TileLayerBorders.updateBorders has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityStateDiplomacyTable.getCityStateDiplomacyTableHeader (cyclomatic 24) core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:95— CityStateDiplomacyTable.getCityStateDiplomacyTableHeader has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorldScreen.update (cyclomatic 24) core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt:419— WorldScreen.update has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConstructionAutomation.getOnetimeUniqueBonuses (cyclomatic 23) core/src/com/unciv/logic/automation/city/ConstructionAutomation.kt:282— ConstructionAutomation.getOnetimeUniqueBonuses has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RoadBetweenCitiesAutomation.getRoadsToBuildFromCity (cyclomatic 23) core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt:129— RoadBetweenCitiesAutomation.getRoadsToBuildFromCity has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityConstructions.completeConstruction (cyclomatic 23) core/src/com/unciv/logic/city/CityConstructions.kt:548— CityConstructions.completeConstruction has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiplomacyTurnManager.nextTurnDiplomaticModifiers (cyclomatic 23) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:280— DiplomacyTurnManager.nextTurnDiplomaticModifiers has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CivInfoTransientCache.updateProximity (cyclomatic 23) core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt:400— CivInfoTransientCache.updateProximity has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UnitMovement.getMovementToTilesAtPosition (cyclomatic 23) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:66— UnitMovement.getMovementToTilesAtPosition has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Unique.getReplacementText (cyclomatic 23) core/src/com/unciv/models/ruleset/unique/Unique.kt:185— Unique.getReplacementText has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImprovementDescriptions.getCivilopediaTextLines (cyclomatic 23) core/src/com/unciv/ui/objectdescriptions/ImprovementDescriptions.kt:50— ImprovementDescriptions.getCivilopediaTextLines has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormattedLine.unsupportedReasons (cyclomatic 23) core/src/com/unciv/ui/screens/civilopediascreen/FormattedLine.kt:127— FormattedLine.unsupportedReasons has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AirUnitAutomation.getNukeLocationValue (cyclomatic 22) core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt:162— AirUnitAutomation.getNukeLocationValue has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapElevationGenerator.cellularMountainRanges (cyclomatic 22) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:71— MapElevationGenerator.cellularMountainRanges has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileImprovementFunctions.setImprovement (cyclomatic 22) core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt:275— TileImprovementFunctions.setImprovement has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityStatsTable.addText (cyclomatic 22) core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:127— CityStatsTable.addText has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameInfo.setTransients (cyclomatic 21) core/src/com/unciv/logic/GameInfo.kt:709— GameInfo.setTransients has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Automation.chooseMilitaryUnit (cyclomatic 21) core/src/com/unciv/logic/automation/Automation.kt:199— Automation.chooseMilitaryUnit has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReligionAutomation.beliefBonusForCity (cyclomatic 21) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:273— ReligionAutomation.beliefBonusForCity has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Battle.attack (cyclomatic 21) core/src/com/unciv/logic/battle/Battle.kt:106— Battle.attack has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GithubAPI.downloadAndExtract (cyclomatic 21) core/src/com/unciv/logic/github/GithubAPI.kt:402— GithubAPI.downloadAndExtract has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapGenerator.applyHumidityAndTemperature (cyclomatic 21) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:539— MapGenerator.applyHumidityAndTemperature has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapRegions.assignRegions (cyclomatic 21) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:237— MapRegions.assignRegions has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitTurnManager.endTurn (cyclomatic 21) core/src/com/unciv/logic/map/mapunit/UnitTurnManager.kt:10— UnitTurnManager.endTurn has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApiV2.handleWebSocket (cyclomatic 21) core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:391— ApiV2.handleWebSocket has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BaseUnit.matchesSingleFilter (cyclomatic 21) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:452— BaseUnit.matchesSingleFilter has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
UniqueValidator.checkUnique (cyclomatic 21) core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt:91— UniqueValidator.checkUnique has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileLayerTerrain.getTileBaseImageLocations (cyclomatic 21) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt:46— TileLayerTerrain.getTileBaseImageLocations has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ImprovementPickerScreen.addImprovementRow (cyclomatic 21) core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:125— ImprovementPickerScreen.addImprovementRow has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run.main (cyclomatic 21) REDACTED:32— run.main has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 67). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
Automation.rankStatsForCityWork (cyclomatic 20) core/src/com/unciv/logic/automation/Automation.kt:79— Automation.rankStatsForCityWork has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NextTurnAutomation.trainSettler (cyclomatic 20) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:636— NextTurnAutomation.trainSettler has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Nuke.doNukeExplosionForTile (cyclomatic 20) core/src/com/unciv/logic/battle/Nuke.kt:195— Nuke.doNukeExplosionForTile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityStats.updateFinalStatList (cyclomatic 20) core/src/com/unciv/logic/city/CityStats.kt:522— CityStats.updateFinalStatList has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExploredRegion.expandToInclude (cyclomatic 20) core/src/com/unciv/logic/civilization/ExploredRegion.kt:96— ExploredRegion.expandToInclude has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileNormalizer.normalizeToRuleset (cyclomatic 20) core/src/com/unciv/logic/map/tile/TileNormalizer.kt:9— TileNormalizer.normalizeToRuleset has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Spy.endTurn (cyclomatic 20) core/src/com/unciv/models/Spy.kt:88— Spy.endTurn has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Terrain.getCivilopediaTextLines (cyclomatic 20) core/src/com/unciv/models/ruleset/tile/Terrain.kt:81— Terrain.getCivilopediaTextLines has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Tokenizer.tokenize (cyclomatic 20) core/src/com/unciv/models/ruleset/unique/expressions/Tokenizer.kt:75— Tokenizer.tokenize has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileGroupMap.draw (cyclomatic 20) core/src/com/unciv/ui/components/tilegroups/TileGroupMap.kt:225— TileGroupMap.draw has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TechnologyDescriptions.getTechEnabledIcons (cyclomatic 20) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:99— TechnologyDescriptions.getTechEnabledIcons has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DetailedStatsPopup.traverseTree (cyclomatic 20) core/src/com/unciv/ui/screens/cityscreen/DetailedStatsPopup.kt:198— DetailedStatsPopup.traverseTree has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LineChart.prepareForDraw (cyclomatic 20) core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:147— LineChart.prepareForDraw has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TargetHelper.getAttackableEnemies (cyclomatic 19) core/src/com/unciv/logic/battle/TargetHelper.kt:15— TargetHelper.getAttackableEnemies has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityExpansionManager.rankTileForExpansion (cyclomatic 19) core/src/com/unciv/logic/city/managers/CityExpansionManager.kt:124— CityExpansionManager.rankTileForExpansion has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapElevationGenerator.cellularHills (cyclomatic 19) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:119— MapElevationGenerator.cellularHills has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapUnit.healingAmountForTile (cyclomatic 19) core/src/com/unciv/logic/map/mapunit/MapUnit.kt:535— MapUnit.healingAmountForTile has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MapUnit.doAction (cyclomatic 19) core/src/com/unciv/logic/map/mapunit/MapUnit.kt:908— MapUnit.doAction has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Policy.getCivilopediaTextLines (cyclomatic 19) core/src/com/unciv/models/ruleset/Policy.kt:79— Policy.getCivilopediaTextLines has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseUnit.evaluateForce (cyclomatic 19) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:534— BaseUnit.evaluateForce has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MusicController.musicTimerTask (cyclomatic 19) core/src/com/unciv/ui/audio/MusicController.kt:240— MusicController.musicTimerTask has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DetailedStatsPopup.update (cyclomatic 19) core/src/com/unciv/ui/screens/cityscreen/DetailedStatsPopup.kt:73— DetailedStatsPopup.update has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImprovementPickerScreen.getProblemReport (cyclomatic 19) core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:277— ImprovementPickerScreen.getProblemReport has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TechPickerScreen.selectTechnology (cyclomatic 19) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:391— TechPickerScreen.selectTechnology has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UniqueDocsWriter.writeUniqueTypes (cyclomatic 19) desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt:80— UniqueDocsWriter.writeUniqueTypes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Automation.allowSpendingResource (cyclomatic 18) core/src/com/unciv/logic/automation/Automation.kt:323— Automation.allowSpendingResource has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReligiousUnitAutomation.automateInquisitor (cyclomatic 18) core/src/com/unciv/logic/automation/unit/ReligiousUnitAutomation.kt:89— ReligiousUnitAutomation.automateInquisitor has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
RoadToAutomation.automateConnectRoad (cyclomatic 18) core/src/com/unciv/logic/automation/unit/RoadToAutomation.kt:34— RoadToAutomation.automateConnectRoad has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Battle.postBattleNotifications (cyclomatic 18) core/src/com/unciv/logic/battle/Battle.kt:517— Battle.postBattleNotifications has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TargetHelper.containsAttackableEnemy (cyclomatic 18) core/src/com/unciv/logic/battle/TargetHelper.kt:113— TargetHelper.containsAttackableEnemy has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GithubAPI.parseUrl (cyclomatic 18) core/src/com/unciv/logic/github/GithubAPI.kt:318— GithubAPI.parseUrl has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TileMap.forEachTileAtDistance (cyclomatic 18) core/src/com/unciv/logic/map/TileMap.kt:319— TileMap.forEachTileAtDistance has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileMap.getNeighborTileClockPosition (cyclomatic 18) core/src/com/unciv/logic/map/TileMap.kt:410— TileMap.getNeighborTileClockPosition has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapGenerator.mirror (cyclomatic 18) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:263— MapGenerator.mirror has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitMovement.getCannotMoveToReason (cyclomatic 18) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:740— UnitMovement.getCannotMoveToReason has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PathingMap.getShortestPath (cyclomatic 18) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:148— PathingMap.getShortestPath has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AStarPathfinder.calculateNeighborNode (cyclomatic 18) core/src/com/unciv/logic/map/pathingmap/PathingMapAStarPathfinder.kt:160— AStarPathfinder.calculateNeighborNode has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseRulesetValidator.checkEventCircularTriggers (cyclomatic 18) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:221— BaseRulesetValidator.checkEventCircularTriggers has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormattedLine.render (cyclomatic 18) core/src/com/unciv/ui/screens/civilopediascreen/FormattedLine.kt:279— FormattedLine.render has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NewGameScreen.getErrorMessage (cyclomatic 18) core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:167— NewGameScreen.getErrorMessage has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ResourcesOverviewTab.getExtraDrilldown (cyclomatic 18) core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt:279— ResourcesOverviewTab.getExtraDrilldown has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VictoryScreenIllustrations.victoryCompletePercent (cyclomatic 18) core/src/com/unciv/ui/screens/victoryscreen/VictoryScreenIllustrations.kt:219— VictoryScreenIllustrations.victoryCompletePercent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorldMapHolder.onTileClicked (cyclomatic 18) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:166— WorldMapHolder.onTileClicked has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DiplomacyAutomation.offerPeaceTreaty (cyclomatic 17) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:399— DiplomacyAutomation.offerPeaceTreaty has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NextTurnAutomation.valueCityStateAlliance (cyclomatic 17) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:168— NextTurnAutomation.valueCityStateAlliance has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CityLocationTileRanker.rankTile (cyclomatic 17) core/src/com/unciv/logic/automation/unit/CityLocationTileRanker.kt:197— CityLocationTileRanker.rankTile has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkerAutomation.isAutomationWorkableTile (cyclomatic 17) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:292— WorkerAutomation.isAutomationWorkableTile has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DiplomacyManager.relationshipIgnoreAfraid (cyclomatic 17) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt:390— DiplomacyManager.relationshipIgnoreAfraid has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TurnManager.endTurn (cyclomatic 17) core/src/com/unciv/logic/civilization/managers/TurnManager.kt:259— TurnManager.endTurn has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Github.rewriteModOptions (cyclomatic 17) core/src/com/unciv/logic/github/Github.kt:193— Github.rewriteModOptions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RegionStartFinder.evaluateTileForStart (cyclomatic 17) core/src/com/unciv/logic/map/mapgenerator/mapregions/RegionStartFinder.kt:158— RegionStartFinder.evaluateTileForStart has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Simulation.text (cyclomatic 17) core/src/com/unciv/logic/simulation/Simulation.kt:232— Simulation.text has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Building.matchesSingleFilter (cyclomatic 17) core/src/com/unciv/models/ruleset/Building.kt:523— Building.matchesSingleFilter has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Ruleset.mergeTechnologies (cyclomatic 17) core/src/com/unciv/models/ruleset/Ruleset.kt:340— Ruleset.mergeTechnologies has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GenerateStringsFromJSONs.serializeElement (cyclomatic 17) core/src/com/unciv/models/translations/TranslationFileWriter.kt:670— GenerateStringsFromJSONs.serializeElement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: GenerateStringsFromJSONs.getJavaClassByName (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
CityTileGroup.update (cyclomatic 17) core/src/com/unciv/ui/components/tilegroups/CityTileGroup.kt:30— CityTileGroup.update has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseUnitDescriptions.getDifferences (cyclomatic 17) core/src/com/unciv/ui/objectdescriptions/BaseUnitDescriptions.kt:263— BaseUnitDescriptions.getDifferences has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ResourceDescriptions.getCivilopediaTextLines (cyclomatic 17) core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:12— ResourceDescriptions.getCivilopediaTextLines has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TechnologyDescriptions.buildTechIconsIndex (cyclomatic 17) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:181— TechnologyDescriptions.buildTechIconsIndex has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TechnologyDescriptions.getCivilopediaTextLines (cyclomatic 17) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:250— TechnologyDescriptions.getCivilopediaTextLines has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModCheckTab.runModChecker (cyclomatic 17) core/src/com/unciv/ui/popups/options/ModCheckTab.kt:130— ModCheckTab.runModChecker has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiplayerTab.addMultiplayerServerOptions (cyclomatic 17) core/src/com/unciv/ui/popups/options/MultiplayerTab.kt:85— MultiplayerTab.addMultiplayerServerOptions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PromotionPickerScreen.addConnectingLines (cyclomatic 17) core/src/com/unciv/ui/screens/pickerscreens/PromotionPickerScreen.kt:264— PromotionPickerScreen.addConnectingLines has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BarbarianManager.placeBarbarianEncampment (cyclomatic 16) core/src/com/unciv/logic/automation/civilization/BarbarianManager.kt:78— BarbarianManager.placeBarbarianEncampment has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiplomacyAutomation.wantsToSignDefensivePact (cyclomatic 16) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:310— DiplomacyAutomation.wantsToSignDefensivePact has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NextTurnAutomation.automateCivMoves (cyclomatic 16) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:47— NextTurnAutomation.automateCivMoves has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AirUnitAutomation.automateFighter (cyclomatic 16) core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt:21— AirUnitAutomation.automateFighter has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BattleHelper.getCityAttackValue (cyclomatic 16) core/src/com/unciv/logic/automation/unit/BattleHelper.kt:93— BattleHelper.getCityAttackValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpecificUnitAutomation.automateImprovementPlacer (cyclomatic 16) core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt:231— SpecificUnitAutomation.automateImprovementPlacer has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitAutomation.tryRetreat (cyclomatic 16) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:295— UnitAutomation.tryRetreat has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnitAutomation.tryHealUnit (cyclomatic 16) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:354— UnitAutomation.tryHealUnit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityConquestFunctions.liberateCity (cyclomatic 16) core/src/com/unciv/logic/city/managers/CityConquestFunctions.kt:203— CityConquestFunctions.liberateCity has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityPopulationManager.unassignExtraPopulation (cyclomatic 16) core/src/com/unciv/logic/city/managers/CityPopulationManager.kt:212— CityPopulationManager.unassignExtraPopulation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CityStateFunctions.updateAllyCivForCityState (cyclomatic 16) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:287— CityStateFunctions.updateAllyCivForCityState has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StartNormalizer.normalizeProduction (cyclomatic 16) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:46— StartNormalizer.normalizeProduction has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StartNormalizer.placeFoodBonuses (cyclomatic 16) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:243— StartNormalizer.placeFoodBonuses has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Milestone.getFocus (cyclomatic 16) core/src/com/unciv/models/ruleset/Victory.kt:410— Milestone.getFocus has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Milestone.getFocusFromCountable (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
BaseRulesetValidator.checkPromotionCircularReferences (cyclomatic 16) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:311— BaseRulesetValidator.checkPromotionCircularReferences has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RulesetValidator.checkTilesetSanity (cyclomatic 16) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:783— RulesetValidator.checkTilesetSanity has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UniqueValidator.getModifierErrors (cyclomatic 16) core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt:234— UniqueValidator.getModifierErrors has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SkinStrings.getUiBackground (cyclomatic 16) core/src/com/unciv/models/skins/SkinStrings.kt:50— SkinStrings.getUiBackground has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FontRulesetIcons.addRulesetImages (cyclomatic 16) core/src/com/unciv/ui/components/fonts/FontRulesetIcons.kt:38— FontRulesetIcons.addRulesetImages has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CityButton.updateHiddenUnitMarkers (cyclomatic 16) core/src/com/unciv/ui/components/tilegroups/citybutton/CityButton.kt:176— CityButton.updateHiddenUnitMarkers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GlobalPoliticsOverviewTable.updateDiagram (cyclomatic 16) core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsOverviewTable.kt:256— GlobalPoliticsOverviewTable.updateDiagram has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TechPickerScreen.createTechTable (cyclomatic 16) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:142— TechPickerScreen.createTechTable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TechPickerScreen.addConnectingLines (cyclomatic 16) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:252— TechPickerScreen.addConnectingLines has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorldMapHolder.moveUnitToTargetTile (cyclomatic 16) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:285— WorldMapHolder.moveUnitToTargetTile has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SystemUtils.getSystemInfo (cyclomatic 16) desktop/src/com/unciv/app/desktop/SystemUtils.kt:11— SystemUtils.getSystemInfo has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repeated repair: core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsDiagramGroup.kt core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsDiagramGroup.kt:180— core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsDiagramGroup.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is WidgetIndex.getRelation at line 180), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “chore: Fix global policy diagram click to open legend intercepted by lines (#15439)”; “chore: Better fix for that `GlobalPoliticsDiagramGroup.Relations.entries` bug (#15410)”; “Solve #15393 GlobalPoliticsDiagramGroup crashing bug - not solved the root cause since this is a compiler bug”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:54:45 +02:00' --until='2026-11-13 11:54:45 +02:00' --full-history --no-merges -- core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsDiagramGroup.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FixmeComment core/src/com/unciv/ui/components/tilegroups/layers/TileLayerMisc.kt:311— // FIXME: Culled when too large and panned away. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
UniqueTriggerActivation.getTriggerFunction (cognitive 501) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:79— UniqueTriggerActivation.getTriggerFunction has cognitive complexity 501 (threshold 15). Drivers by points: if/else 215 (408 pts), boolean chains 43, loops 18 (39 pts), match/switch 7 (11 pts) (nesting depth added 218). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ruleset.load (cognitive 89) core/src/com/unciv/models/ruleset/Ruleset.kt:484— Ruleset.load has cognitive complexity 89 (threshold 15). Drivers by points: if/else 41 (65 pts), loops 8 (20 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldMapTileUpdater.updateTilesForSelectedUnit (cognitive 87) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapTileUpdater.kt:61— WorldMapTileUpdater.updateTilesForSelectedUnit has cognitive complexity 87 (threshold 15). Drivers by points: if/else 35 (59 pts), loops 9 (18 pts), boolean chains 10 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Building.getRejectionReasons (cognitive 85) core/src/com/unciv/models/ruleset/Building.kt:280— Building.getRejectionReasons has cognitive complexity 85 (threshold 15). Drivers by points: if/else 35 (68 pts), boolean chains 9, loops 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Milestone.getVictoryScreenButtons (cognitive 85) core/src/com/unciv/models/ruleset/Victory.kt:277— Milestone.getVictoryScreenButtons has cognitive complexity 85 (threshold 15). Drivers by points: if/else 25 (58 pts), loops 7 (14 pts), boolean chains 12, match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Conditionals.conditionalApplies (cognitive 70) core/src/com/unciv/models/ruleset/unique/Conditionals.kt:28— Conditionals.conditionalApplies has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 38, if/else 26 (31 pts), match/switch 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TileGroupMap.draw (cognitive 60) core/src/com/unciv/ui/components/tilegroups/TileGroupMap.kt:225— TileGroupMap.draw has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 4 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UnitMovement.getShortestPath (cognitive 56) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:155— UnitMovement.getShortestPath has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 5 (13 pts), boolean chains 6 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UncivServerRunner.serverRun (cognitive 54) server/src/com/unciv/app/server/UncivServer.kt:281— UncivServerRunner.serverRun has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30 (42 pts), match/switch 2 (5 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConstructions.completeConstruction (cognitive 53) core/src/com/unciv/logic/city/CityConstructions.kt:548— CityConstructions.completeConstruction has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (40 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CivilianUnitAutomation.automateCivilianUnit (cognitive 52) core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt:23— CivilianUnitAutomation.automateCivilianUnit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30 (39 pts), boolean chains 13 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapElevationGenerator.cellularMountainRanges (cognitive 48) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:71— MapElevationGenerator.cellularMountainRanges has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeEvaluation.evaluateSellCost (cognitive 48) core/src/com/unciv/logic/trade/TradeEvaluation.kt:370— TradeEvaluation.evaluateSellCost has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 6 (12 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PromotionTree.update (cognitive 48) core/src/com/unciv/ui/screens/pickerscreens/PromotionTree.kt:72— PromotionTree.update has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 7 (11 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BattleTable.simulateBattle (cognitive 48) core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:180— BattleTable.simulateBattle has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 10, match/switch 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeLogic.acceptTrade (cognitive 47) core/src/com/unciv/logic/trade/TradeLogic.kt:115— TradeLogic.acceptTrade has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 10, loops 5 (8 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseUnit.getRejectionReasons (cognitive 47) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:233— BaseUnit.getRejectionReasons has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 9 (13 pts), boolean chains 6 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeAutomation.getCounteroffer (cognitive 46) core/src/com/unciv/logic/automation/civilization/TradeAutomation.kt:55— TradeAutomation.getCounteroffer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 10, loops 7 (9 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyTurnManager.nextTurnFlags (cognitive 46) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:150— DiplomacyTurnManager.nextTurnFlags has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 3 (8 pts), match/switch 2 (6 pts), boolean chains 4 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerAutomation.getImprovementRanking (cognitive 45) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:513— WorkerAutomation.getImprovementRanking has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 11 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapGenerator.applyHumidityAndTemperature (cognitive 45) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:539— MapGenerator.applyHumidityAndTemperature has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (37 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UniqueDocsWriter.writeUniqueTypes (cognitive 45) desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt:80— UniqueDocsWriter.writeUniqueTypes has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 3 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitMovement.getMovementToTilesAtPosition (cognitive 44) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:66— UnitMovement.getMovementToTilesAtPosition has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 6, loops 3 (6 pts), match/switch 1 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeEvaluation.evaluateBuyCost (cognitive 44) core/src/com/unciv/logic/trade/TradeEvaluation.kt:165— TradeEvaluation.evaluateBuyCost has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (33 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OffersListScroll.update (cognitive 44) core/src/com/unciv/ui/screens/diplomacyscreen/OffersListScroll.kt:48— OffersListScroll.update has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 3 (8 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpecificUnitAutomation.automateSettlerActions (cognitive 43) core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt:113— SpecificUnitAutomation.automateSettlerActions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 15 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BaseUnitDescriptions.getBaseUnitCivilopediaTextLines (cognitive 43) core/src/com/unciv/ui/objectdescriptions/BaseUnitDescriptions.kt:87— BaseUnitDescriptions.getBaseUnitCivilopediaTextLines has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 8, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AirUnitAutomation.getNukeLocationValue (cognitive 42) core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt:162— AirUnitAutomation.getNukeLocationValue has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitMovement.moveToTile (cognitive 42) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:500— UnitMovement.moveToTile has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileDescription.toMarkup (cognitive 42) core/src/com/unciv/ui/objectdescriptions/TileDescription.kt:23— TileDescription.toMarkup has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 10, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UnitActionsTable.update (cognitive 42) core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt:58— UnitActionsTable.update has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 8 (13 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitAutomation.automateUnitMoves (cognitive 40) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:53— UnitAutomation.automateUnitMoves has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 11 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ExploredRegion.expandToInclude (cognitive 40) core/src/com/unciv/logic/civilization/ExploredRegion.kt:96— ExploredRegion.expandToInclude has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileStatFunctions.getTileStatsBreakdown (cognitive 40) core/src/com/unciv/logic/map/tile/TileStatFunctions.kt:57— TileStatFunctions.getTileStatsBreakdown has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26 (36 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Unique.getReplacementText (cognitive 40) core/src/com/unciv/models/ruleset/unique/Unique.kt:185— Unique.getReplacementText has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 10, match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.checkUnit (cognitive 40) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:489— BaseRulesetValidator.checkUnit has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 9 (12 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildingDescriptions.getBuildingCivilopediaTextLines (cognitive 40) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:168— BuildingDescriptions.getBuildingCivilopediaTextLines has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26 (32 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DetailedStatsPopup.traverseTree (cognitive 40) core/src/com/unciv/ui/screens/cityscreen/DetailedStatsPopup.kt:198— DetailedStatsPopup.traverseTree has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 4 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitMovement.cannotPassThroughReason (cognitive 39) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:884— UnitMovement.cannotPassThroughReason has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 15 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildingDescriptions.getDescription (cognitive 39) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:48— BuildingDescriptions.getDescription has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoadBetweenCitiesAutomation.getRoadsToBuildFromCity (cognitive 38) core/src/com/unciv/logic/automation/unit/RoadBetweenCitiesAutomation.kt:129— RoadBetweenCitiesAutomation.getRoadsToBuildFromCity has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiV2.handleWebSocket (cognitive 38) core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:391— ApiV2.handleWebSocket has cognitive complexity 38 (threshold 15). Drivers by points: error handling 7 (18 pts), if/else 4 (8 pts), loops 3 (6 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineChart.prepareForDraw (cognitive 38) core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:147— LineChart.prepareForDraw has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (30 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionStartFinder.evaluateTileForStart (cognitive 37) core/src/com/unciv/logic/map/mapgenerator/mapregions/RegionStartFinder.kt:158— RegionStartFinder.evaluateTileForStart has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MovementCost.getMovementCostBetweenAdjacentTiles (cognitive 37) core/src/com/unciv/logic/map/mapunit/movement/MovementCost.kt:40— MovementCost.getMovementCostBetweenAdjacentTiles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 13 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CityStateDiplomacyTable.getCityStateDiplomacyTableHeader (cognitive 37) core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:95— CityStateDiplomacyTable.getCityStateDiplomacyTableHeader has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (28 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapElevationGenerator.cellularHills (cognitive 34) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:119— MapElevationGenerator.cellularHills has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer.tokenize (cognitive 34) core/src/com/unciv/models/ruleset/unique/expressions/Tokenizer.kt:75— Tokenizer.tokenize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DetailedStatsPopup.update (cognitive 34) core/src/com/unciv/ui/screens/cityscreen/DetailedStatsPopup.kt:73— DetailedStatsPopup.update has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 5 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechPickerScreen.addConnectingLines (cognitive 34) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:252— TechPickerScreen.addConnectingLines has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2 (6 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TurnManager.startTurn (cognitive 33) core/src/com/unciv/logic/civilization/managers/TurnManager.kt:29— TurnManager.startTurn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 9 (13 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simulation.text (cognitive 33) core/src/com/unciv/logic/simulation/Simulation.kt:232— Simulation.text has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileLayerBorders.updateBorders (cognitive 33) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerBorders.kt:34— TileLayerBorders.updateBorders has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechnologyDescriptions.getTechEnabledIcons (cognitive 33) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:99— TechnologyDescriptions.getTechEnabledIcons has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (22 pts), loops 6, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RoadToAutomation.automateConnectRoad (cognitive 32) core/src/com/unciv/logic/automation/unit/RoadToAutomation.kt:34— RoadToAutomation.automateConnectRoad has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitAutomation.tryRetreat (cognitive 32) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:295— UnitAutomation.tryRetreat has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· main (cognitive 32) · ×1
main (cognitive 32) web/validation/http-fetch-engine/browser-fetch-contract.cjs:22— main has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 12, ternaries 2, error handling 1, other 1. Of this number, 18 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TileLayerTerrain.getTileBaseImageLocations (cognitive 31) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt:46— TileLayerTerrain.getTileBaseImageLocations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 3, match/switch 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CivilopediaSearchPopup.searchLoop (cognitive 31) core/src/com/unciv/ui/screens/civilopediascreen/CivilopediaSearchPopup.kt:115— CivilopediaSearchPopup.searchLoop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NewGameScreen.getErrorMessage (cognitive 31) core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:167— NewGameScreen.getErrorMessage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImprovementPickerScreen.getProblemReport (cognitive 31) core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:277— ImprovementPickerScreen.getProblemReport has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromotionPickerScreen.addConnectingLines (cognitive 31) core/src/com/unciv/ui/screens/pickerscreens/PromotionPickerScreen.kt:264— PromotionPickerScreen.addConnectingLines has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Automation.allowSpendingResource (cognitive 30) core/src/com/unciv/logic/automation/Automation.kt:323— Automation.allowSpendingResource has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyAutomation.offerPeaceTreaty (cognitive 30) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:399— DiplomacyAutomation.offerPeaceTreaty has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 5, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReligionAutomation.beliefBonusForCity (cognitive 30) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:273— ReligionAutomation.beliefBonusForCity has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityStateFunctions.getTributeModifiers (cognitive 30) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:487— CityStateFunctions.getTributeModifiers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 7, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapGenerator.spawnLakesAndCoasts (cognitive 30) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:401— MapGenerator.spawnLakesAndCoasts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (13 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NaturalWonderGenerator.placeNaturalWonder (cognitive 30) core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt:143— NaturalWonderGenerator.placeNaturalWonder has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeLogic.getAvailableOffers (cognitive 30) core/src/com/unciv/logic/trade/TradeLogic.kt:39— TradeLogic.getAvailableOffers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 6 (9 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ResourcesOverviewTab.getExtraDrilldown (cognitive 30) core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt:279— ResourcesOverviewTab.getExtraDrilldown has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8 (12 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldScreen.update (cognitive 30) core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt:419— WorldScreen.update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CivInfoTransientCache.updateProximity (cognitive 29) core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt:400— CivInfoTransientCache.updateProximity has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StartNormalizer.placeFoodBonuses (cognitive 29) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:243— StartNormalizer.placeFoodBonuses has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.addTechErrors (cognitive 29) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:413— BaseRulesetValidator.addTechErrors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModCheckTab.runModChecker (cognitive 29) core/src/com/unciv/ui/popups/options/ModCheckTab.kt:130— ModCheckTab.runModChecker has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameInfo.nextTurn (cognitive 28) core/src/com/unciv/logic/GameInfo.kt:384— GameInfo.nextTurn has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (13 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MotivationToAttackAutomation.hasAtLeastMotivationToAttack (cognitive 28) core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:31— MotivationToAttackAutomation.hasAtLeastMotivationToAttack has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 6, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MotivationToAttackAutomation.getAttackPathsModifier (cognitive 28) core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt:328— MotivationToAttackAutomation.getAttackPathsModifier has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Nuke.doNukeExplosionForTile (cognitive 28) core/src/com/unciv/logic/battle/Nuke.kt:195— Nuke.doNukeExplosionForTile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileMap.forEachTileAtDistance (cognitive 28) core/src/com/unciv/logic/map/TileMap.kt:319— TileMap.forEachTileAtDistance has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModManagementScreen.addModInfoFromRepoSearch (cognitive 28) core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt:313— ModManagementScreen.addModInfoFromRepoSearch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (8 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreatManager.getDistanceToClosestEnemyUnit (cognitive 27) core/src/com/unciv/logic/automation/civilization/ThreatManager.kt:25— ThreatManager.getDistanceToClosestEnemyUnit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetHelper.getAttackableEnemies (cognitive 27) core/src/com/unciv/logic/battle/TargetHelper.kt:15— TargetHelper.getAttackableEnemies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityExpansionManager.rankTileForExpansion (cognitive 27) core/src/com/unciv/logic/city/managers/CityExpansionManager.kt:124— CityExpansionManager.rankTileForExpansion has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityPopulationManager.unassignExtraPopulation (cognitive 27) core/src/com/unciv/logic/city/managers/CityPopulationManager.kt:212— CityPopulationManager.unassignExtraPopulation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartNormalizer.calculateFoodBonusesNeeded (cognitive 27) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:175— StartNormalizer.calculateFoodBonusesNeeded has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (9 pts), match/switch 2 (4 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Policy.getCivilopediaTextLines (cognitive 27) core/src/com/unciv/models/ruleset/Policy.kt:79— Policy.getCivilopediaTextLines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Milestone.getVictoryScreenButtonHeaderText (cognitive 27) core/src/com/unciv/models/ruleset/Victory.kt:202— Milestone.getVictoryScreenButtonHeaderText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Terrain.getCivilopediaTextLines (cognitive 27) core/src/com/unciv/models/ruleset/tile/Terrain.kt:81— Terrain.getCivilopediaTextLines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MusicController.musicTimerTask (cognitive 27) core/src/com/unciv/ui/audio/MusicController.kt:240— MusicController.musicTimerTask has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Scene2dExtensionsKt.equalizeColumns (cognitive 27) core/src/com/unciv/ui/components/extensions/Scene2dExtensions.kt:512— Scene2dExtensionsKt.equalizeColumns has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileLayerTerrain.updateTileImage (cognitive 27) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt:172— TileLayerTerrain.updateTileImage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImprovementDescriptions.getCivilopediaTextLines (cognitive 27) core/src/com/unciv/ui/objectdescriptions/ImprovementDescriptions.kt:50— ImprovementDescriptions.getCivilopediaTextLines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5, loops 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CityStatsTable.addText (cognitive 27) core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:127— CityStatsTable.addText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 3, boolean chains 2, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechPickerScreen.createTechTable (cognitive 27) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:142— TechPickerScreen.createTechTable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 6 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameInfo.setTransients (cognitive 26) core/src/com/unciv/logic/GameInfo.kt:709— GameInfo.setTransients has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 10 (11 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRegions.assignRegions (cognitive 26) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:237— MapRegions.assignRegions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 8, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapUnit.doAction (cognitive 26) core/src/com/unciv/logic/map/mapunit/MapUnit.kt:908— MapUnit.doAction has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AStarPathfinder.calculateNeighborNode (cognitive 26) core/src/com/unciv/logic/map/pathingmap/PathingMapAStarPathfinder.kt:160— AStarPathfinder.calculateNeighborNode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TileImprovementFunctions.setImprovement (cognitive 26) core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt:275— TileImprovementFunctions.setImprovement has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseUnit.evaluateForce (cognitive 26) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:534— BaseUnit.evaluateForce has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UniqueValidator.checkUnique (cognitive 26) core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt:91— UniqueValidator.checkUnique has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CitizenManagementTable.update (cognitive 26) core/src/com/unciv/ui/screens/cityscreen/CitizenManagementTable.kt:17— CitizenManagementTable.update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameStarter.addCivTechs (cognitive 25) core/src/com/unciv/logic/GameStarter.kt:175— GameStarter.addCivTechs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (11 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReligionAutomation.beliefBonusForPlayer (cognitive 25) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:326— ReligionAutomation.beliefBonusForPlayer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BattleHelper.getCityAttackValue (cognitive 25) core/src/com/unciv/logic/automation/unit/BattleHelper.kt:93— BattleHelper.getCityAttackValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Battle.attack (cognitive 25) core/src/com/unciv/logic/battle/Battle.kt:106— Battle.attack has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DiplomacyTurnManager.nextTurnTrades (cognitive 25) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:245— DiplomacyTurnManager.nextTurnTrades has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StrategicBonusResourcePlacementLogic.buildRuleLists (cognitive 25) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:310— StrategicBonusResourcePlacementLogic.buildRuleLists has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileResource.generatesNaturallyOn (cognitive 25) core/src/com/unciv/models/ruleset/tile/TileResource.kt:147— TileResource.generatesNaturallyOn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobalPoliticsOverviewTable.updateDiagram (cognitive 25) core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsOverviewTable.kt:256— GlobalPoliticsOverviewTable.updateDiagram has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldMapHolder.onTileClicked (cognitive 25) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:166— WorldMapHolder.onTileClicked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MultiplayerTurnCheckWorker.doWork (cognitive 24) android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt:288— MultiplayerTurnCheckWorker.doWork has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Automation.rankStatsForCityWork (cognitive 24) core/src/com/unciv/logic/automation/Automation.kt:79— Automation.rankStatsForCityWork has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Automation.chooseMilitaryUnit (cognitive 24) core/src/com/unciv/logic/automation/Automation.kt:199— Automation.chooseMilitaryUnit has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (8 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SpecificUnitAutomation.automateImprovementPlacer (cognitive 24) core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt:231— SpecificUnitAutomation.automateImprovementPlacer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 8, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityStateFunctions.makeOtherCityStatesWaryOfAttacker (cognitive 24) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:744— CityStateFunctions.makeOtherCityStatesWaryOfAttacker has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyFunctions.meetCiv (cognitive 24) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:31— DiplomacyFunctions.meetCiv has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CivInfoTransientCache.discoverNaturalWonders (cognitive 24) core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt:224— CivInfoTransientCache.discoverNaturalWonders has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitActionModifiers.activateSideEffects (cognitive 24) core/src/com/unciv/logic/map/mapunit/actions/UnitActionModifiers.kt:98— UnitActionModifiers.activateSideEffects has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageGetter.loadModAtlases (cognitive 24) core/src/com/unciv/ui/images/ImageGetter.kt:103— ImageGetter.loadModAtlases has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechnologyDescriptions.getCivilopediaTextLines (cognitive 24) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:250— TechnologyDescriptions.getCivilopediaTextLines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 4 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CityConstructionsTable.getConstructionButton (cognitive 24) core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt:509— CityConstructionsTable.getConstructionButton has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NewGameScreen.startNewGame (cognitive 24) core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt:303— NewGameScreen.startNewGame has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (6 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechPickerScreen.selectTechnology (cognitive 24) core/src/com/unciv/ui/screens/pickerscreens/TechPickerScreen.kt:391— TechPickerScreen.selectTechnology has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VictoryScreenIllustrations.victoryCompletePercent (cognitive 24) core/src/com/unciv/ui/screens/victoryscreen/VictoryScreenIllustrations.kt:219— VictoryScreenIllustrations.victoryCompletePercent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitPresenter.update (cognitive 24) core/src/com/unciv/ui/screens/worldscreen/unit/presenter/UnitPresenter.kt:51— UnitPresenter.update has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextTurnAutomation.trainSettler (cognitive 23) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:636— NextTurnAutomation.trainSettler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WorkerAutomation.findTileToWork (cognitive 23) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:232— WorkerAutomation.findTileToWork has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Battle.postBattleNotifications (cognitive 23) core/src/com/unciv/logic/battle/Battle.kt:517— Battle.postBattleNotifications has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 5, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CityStats.updateFinalStatList (cognitive 23) core/src/com/unciv/logic/city/CityStats.kt:522— CityStats.updateFinalStatList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 6 (7 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CityStateFunctions.updateAllyCivForCityState (cognitive 23) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:287— CityStateFunctions.updateAllyCivForCityState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclareWar.breakTreaties (cognitive 23) core/src/com/unciv/logic/civilization/diplomacy/DeclareWar.kt:237— DeclareWar.breakTreaties has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechManager.moveToNewEra (cognitive 23) core/src/com/unciv/logic/civilization/managers/TechManager.kt:436— TechManager.moveToNewEra has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OdMapImport.build (cognitive 23) core/src/com/unciv/logic/map/OdMapImport.kt:92— OdMapImport.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitTurnManager.endTurn (cognitive 23) core/src/com/unciv/logic/map/mapunit/UnitTurnManager.kt:10— UnitTurnManager.endTurn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileNormalizer.normalizeToRuleset (cognitive 23) core/src/com/unciv/logic/map/tile/TileNormalizer.kt:9— TileNormalizer.normalizeToRuleset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BaseRulesetValidator.addEraErrors (cognitive 23) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:94— BaseRulesetValidator.addEraErrors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.checkPromotionCircularReferences (cognitive 23) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:311— BaseRulesetValidator.checkPromotionCircularReferences has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 7 (9 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UniqueValidator.getModifierErrors (cognitive 23) core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt:234— UniqueValidator.getModifierErrors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenerateStringsFromJSONs.serializeElement (cognitive 23) core/src/com/unciv/models/translations/TranslationFileWriter.kt:670— GenerateStringsFromJSONs.serializeElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NationDescriptions.getNationCivilopediaTextLines (cognitive 23) core/src/com/unciv/ui/objectdescriptions/NationDescriptions.kt:20— NationDescriptions.getNationCivilopediaTextLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormattedLine.unsupportedReasons (cognitive 23) core/src/com/unciv/ui/screens/civilopediascreen/FormattedLine.kt:127— FormattedLine.unsupportedReasons has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormattedLine.render (cognitive 23) core/src/com/unciv/ui/screens/civilopediascreen/FormattedLine.kt:279— FormattedLine.render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WonderInfo.collectInfo (cognitive 23) core/src/com/unciv/ui/screens/overviewscreen/WonderOverviewTab.kt:161— WonderInfo.collectInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImprovementPickerScreen.addImprovementRow (cognitive 23) core/src/com/unciv/ui/screens/pickerscreens/ImprovementPickerScreen.kt:125— ImprovementPickerScreen.addImprovementRow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SystemUtils.getSystemInfo (cognitive 23) desktop/src/com/unciv/app/desktop/SystemUtils.kt:11— SystemUtils.getSystemInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BarbarianManager.placeBarbarianEncampment (cognitive 22) core/src/com/unciv/logic/automation/civilization/BarbarianManager.kt:78— BarbarianManager.placeBarbarianEncampment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReligionAutomation.beliefBonusForTile (cognitive 22) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:243— ReligionAutomation.beliefBonusForTile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerAutomation.chooseImprovement (cognitive 22) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:422— WorkerAutomation.chooseImprovement has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), match/switch 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DeclareWar.changeOpinions (cognitive 22) core/src/com/unciv/logic/civilization/diplomacy/DeclareWar.kt:201— DeclareWar.changeOpinions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyTurnManager.nextTurnDiplomaticModifiers (cognitive 22) core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:280— DiplomacyTurnManager.nextTurnDiplomaticModifiers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TileMap.placeUnitNearTile (cognitive 22) core/src/com/unciv/logic/map/TileMap.kt:678— TileMap.placeUnitNearTile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapGenerationRandomness.chooseSpreadOutLocations (cognitive 22) core/src/com/unciv/logic/map/mapgenerator/MapGenerationRandomness.kt:118— MapGenerationRandomness.chooseSpreadOutLocations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (10 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapGenerator.mirror (cognitive 22) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:263— MapGenerator.mirror has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, match/switch 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathingMap.getShortestPath (cognitive 22) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:148— PathingMap.getShortestPath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathingMap.pathAsListWithDamage (cognitive 22) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:211— PathingMap.pathAsListWithDamage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tile.matchesSingleTerrainFilter (cognitive 22) core/src/com/unciv/logic/map/tile/Tile.kt:572— Tile.matchesSingleTerrainFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 9, match/switch 2 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TradeRequest.decline (cognitive 22) core/src/com/unciv/logic/trade/Trade.kt:56— TradeRequest.decline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RulesetCache.loadRulesets (cognitive 22) core/src/com/unciv/models/ruleset/RulesetCache.kt:27— RulesetCache.loadRulesets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RulesetValidator.addImprovementErrors (cognitive 22) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:246— RulesetValidator.addImprovementErrors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseUnitDescriptions.getDifferences (cognitive 22) core/src/com/unciv/ui/objectdescriptions/BaseUnitDescriptions.kt:263— BaseUnitDescriptions.getDifferences has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TechnologyDescriptions.buildTechIconsIndex (cognitive 22) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:181— TechnologyDescriptions.buildTechIconsIndex has cognitive complexity 22 (threshold 15). Drivers by points: loops 11 (17 pts), boolean chains 5 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MultiplayerTab.addMultiplayerServerOptions (cognitive 22) core/src/com/unciv/ui/popups/options/MultiplayerTab.kt:85— MultiplayerTab.addMultiplayerServerOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DiplomacyScreen.updateLeftSideTable (cognitive 22) core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt:141— DiplomacyScreen.updateLeftSideTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourcesOverviewTab.updateVertical (cognitive 22) core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt:222— ResourcesOverviewTab.updateVertical has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 6 (11 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldMapHolder.updateMovementOverlay (cognitive 22) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:598— WorldMapHolder.updateMovementOverlay has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitAutomation.tryHealUnit (cognitive 21) core/src/com/unciv/logic/automation/unit/UnitAutomation.kt:354— UnitAutomation.tryHealUnit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetHelper.containsAttackableEnemy (cognitive 21) core/src/com/unciv/logic/battle/TargetHelper.kt:113— TargetHelper.containsAttackableEnemy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConquestFunctions.liberateCity (cognitive 21) core/src/com/unciv/logic/city/managers/CityConquestFunctions.kt:203— CityConquestFunctions.liberateCity has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GithubAPI.downloadAndExtract (cognitive 21) core/src/com/unciv/logic/github/GithubAPI.kt:402— GithubAPI.downloadAndExtract has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UnitActions.getGiftActions (cognitive 21) core/src/com/unciv/logic/map/mapunit/actions/UnitActions.kt:202— UnitActions.getGiftActions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitActionsFromUniques.getTriggerUniqueActions (cognitive 21) core/src/com/unciv/logic/map/mapunit/actions/UnitActionsFromUniques.kt:203— UnitActionsFromUniques.getTriggerUniqueActions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileImprovementFunctions.canImprovementBeBuiltHere (cognitive 21) core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt:140— TileImprovementFunctions.canImprovementBeBuiltHere has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 6, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Spy.endTurn (cognitive 21) core/src/com/unciv/models/Spy.kt:88— Spy.endTurn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.checkEventCircularTriggers (cognitive 21) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:221— BaseRulesetValidator.checkEventCircularTriggers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FontRulesetIcons.addRulesetImages (cognitive 21) core/src/com/unciv/ui/components/fonts/FontRulesetIcons.kt:38— FontRulesetIcons.addRulesetImages has cognitive complexity 21 (threshold 15). Drivers by points: loops 10 (13 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NotificationsScroll.updateContent (cognitive 21) core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt:224— NotificationsScroll.updateContent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityLocationTileRanker.rankTileToSettle (cognitive 20) core/src/com/unciv/logic/automation/unit/CityLocationTileRanker.kt:112— CityLocationTileRanker.rankTileToSettle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerAutomation.getImprovementPriority (cognitive 20) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:357— WorkerAutomation.getImprovementPriority has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NaturalWonderGenerator.spawnNaturalWonders (cognitive 20) core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt:27— NaturalWonderGenerator.spawnNaturalWonders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionStartFinder.findGoodPosition (cognitive 20) core/src/com/unciv/logic/map/mapgenerator/mapregions/RegionStartFinder.kt:45— RegionStartFinder.findGoodPosition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartNormalizer.normalizeProduction (cognitive 20) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:46— StartNormalizer.normalizeProduction has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StrategicBonusResourcePlacementLogic.placeBonusInThirdRingOfStart (cognitive 20) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:80— StrategicBonusResourcePlacementLogic.placeBonusInThirdRingOfStart has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Promotion.getCivilopediaTextLines (cognitive 20) core/src/com/unciv/models/ruleset/unit/Promotion.kt:70— Promotion.getCivilopediaTextLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.addTerrainErrors (cognitive 20) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:454— BaseRulesetValidator.addTerrainErrors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranslationFileWriter.writeLanguageFile (cognitive 20) core/src/com/unciv/models/translations/TranslationFileWriter.kt:366— TranslationFileWriter.writeLanguageFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityScreen.updateAnnexAndRazeCityButton (cognitive 20) core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt:301— CityScreen.updateAnnexAndRazeCityButton has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldScreen.nextTurn (cognitive 20) core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt:589— WorldScreen.nextTurn has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 4, match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitTable.tileSelected (cognitive 20) core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt:211— UnitTable.tileSelected has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 6, match/switch 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ImagePacker.packImages (cognitive 20) desktop/src/com/unciv/app/desktop/ImagePacker.kt:76— ImagePacker.packImages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (6 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run.main (cognitive 20) REDACTED:32— run.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 5, loops 2, error handling 1. Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 67). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
NextTurnAutomation.automateCivMoves (cognitive 19) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:47— NextTurnAutomation.automateCivMoves has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreatManager.getTilesWithEnemyUnitsInDistance (cognitive 19) core/src/com/unciv/logic/automation/civilization/ThreatManager.kt:80— ThreatManager.getTilesWithEnemyUnitsInDistance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AirUnitAutomation.automateFighter (cognitive 19) core/src/com/unciv/logic/automation/unit/AirUnitAutomation.kt:21— AirUnitAutomation.automateFighter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ReligiousUnitAutomation.automateInquisitor (cognitive 19) core/src/com/unciv/logic/automation/unit/ReligiousUnitAutomation.kt:89— ReligiousUnitAutomation.automateInquisitor has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), match/switch 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Battle.takeDamage (cognitive 19) core/src/com/unciv/logic/battle/Battle.kt:377— Battle.takeDamage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConstructions.purchaseConstruction (cognitive 19) core/src/com/unciv/logic/city/CityConstructions.kt:797— CityConstructions.purchaseConstruction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TurnManager.startTurnFlags (cognitive 19) core/src/com/unciv/logic/civilization/managers/TurnManager.kt:124— TurnManager.startTurnFlags has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TurnManager.endTurn (cognitive 19) core/src/com/unciv/logic/civilization/managers/TurnManager.kt:259— TurnManager.endTurn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CivInfoTransientCache.updateCivResources (cognitive 19) core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt:339— CivInfoTransientCache.updateCivResources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OdMapExport.write (cognitive 19) core/src/com/unciv/logic/map/OdMapExport.kt:45— OdMapExport.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRegions.splitRegion (cognitive 19) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:177— MapRegions.splitRegion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRegionResources.placeResourcesInTiles (cognitive 19) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/MapRegionResources.kt:26— MapRegionResources.placeResourcesInTiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRegionResources.tryAddingResourceToTiles (cognitive 19) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/MapRegionResources.kt:88— MapRegionResources.tryAddingResourceToTiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitMovement.getCannotMoveToReason (cognitive 19) core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt:740— UnitMovement.getCannotMoveToReason has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RulesetValidator.addSpeedErrors (cognitive 19) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:419— RulesetValidator.addSpeedErrors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RulesetValidator.checkTilesetSanity (cognitive 19) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:783— RulesetValidator.checkTilesetSanity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TranslationExtensionsKt.findMatchingAnyKind (cognitive 19) core/src/com/unciv/models/translations/TranslationExtensions.kt:172— TranslationExtensionsKt.findMatchingAnyKind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColorMarkupLabel.prepareText (cognitive 19) core/src/com/unciv/ui/components/widgets/ColorMarkupLabel.kt:122— ColorMarkupLabel.prepareText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabbedPager.selectPage (cognitive 19) core/src/com/unciv/ui/components/widgets/TabbedPager.kt:364— TabbedPager.selectPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceDescriptions.getCivilopediaTextLines (cognitive 19) core/src/com/unciv/ui/objectdescriptions/ResourceDescriptions.kt:12— ResourceDescriptions.getCivilopediaTextLines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LineChart.generateLabels (cognitive 19) core/src/com/unciv/ui/screens/victoryscreen/LineChart.kt:86— LineChart.generateLabels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WorldMapHolder.onTileRightClicked (cognitive 19) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:230— WorldMapHolder.onTileRightClicked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldMapHolder.moveUnitToTargetTile (cognitive 19) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:285— WorldMapHolder.moveUnitToTargetTile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 2, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorldMapHolder.addTileOverlaysWithUnitMovement (cognitive 19) core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:428— WorldMapHolder.addTileOverlaysWithUnitMovement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyAutomation.offerToEstablishEmbassy (cognitive 18) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:131— DiplomacyAutomation.offerToEstablishEmbassy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextTurnAutomation.valueCityStateAlliance (cognitive 18) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:168— NextTurnAutomation.valueCityStateAlliance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NextTurnAutomation.automateUnits (cognitive 18) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:423— NextTurnAutomation.automateUnits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextTurnAutomation.automateCityConquer (cognitive 18) core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt:500— NextTurnAutomation.automateCityConquer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Battle.plunderFromDamage (cognitive 18) core/src/com/unciv/logic/battle/Battle.kt:467— Battle.plunderFromDamage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConstructions.validatedCopyOf (cognitive 18) core/src/com/unciv/logic/city/CityConstructions.kt:422— CityConstructions.validatedCopyOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LabeledSounds.cacheMods (cognitive 18) core/src/com/unciv/logic/files/IMediaFinder.kt:237— LabeledSounds.cacheMods has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GithubAPI.parseUrl (cognitive 18) core/src/com/unciv/logic/github/GithubAPI.kt:318— GithubAPI.parseUrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TileMap.getNeighborTileClockPosition (cognitive 18) core/src/com/unciv/logic/map/TileMap.kt:410— TileMap.getNeighborTileClockPosition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 6, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapGenerator.spreadCoast (cognitive 18) core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt:375— MapGenerator.spreadCoast has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapLandmassGenerator.generateFlatEarthExtraWater (cognitive 18) core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt:73— MapLandmassGenerator.generateFlatEarthExtraWater has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MapRegions.generateRegions (cognitive 18) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapRegions.kt:96— MapRegions.generateRegions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitActionsFromUniques.getTransformActions (cognitive 18) core/src/com/unciv/logic/map/mapunit/actions/UnitActionsFromUniques.kt:354— UnitActionsFromUniques.getTransformActions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Building.notMetRejections (cognitive 18) core/src/com/unciv/models/ruleset/Building.kt:451— Building.notMetRejections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseUnit.notMetRejections (cognitive 18) core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:328— BaseUnit.notMetRejections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.addPolicyErrors (cognitive 18) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:187— BaseRulesetValidator.addPolicyErrors has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechnologyDescriptions.getDescription (cognitive 18) core/src/com/unciv/ui/objectdescriptions/TechnologyDescriptions.kt:30— TechnologyDescriptions.getDescription has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 4). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CityConstructionsTable.updateAvailableConstructions (cognitive 18) core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt:336— CityConstructionsTable.updateAvailableConstructions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 2 (7 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayerPickerTable.update (cognitive 18) core/src/com/unciv/ui/screens/newgamescreen/PlayerPickerTable.kt:88— PlayerPickerTable.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationsScroll.update (cognitive 18) core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt:162— NotificationsScroll.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CityLocationTileRanker.canSettleTile (cognitive 17) core/src/com/unciv/logic/automation/unit/CityLocationTileRanker.kt:88— CityLocationTileRanker.canSettleTile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerAutomation.getBasePriority (cognitive 17) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:322— WorkerAutomation.getBasePriority has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConquestFunctions.diplomaticRepercussionsForLiberatingCity (cognitive 17) core/src/com/unciv/logic/city/managers/CityConquestFunctions.kt:247— CityConquestFunctions.diplomaticRepercussionsForLiberatingCity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityStateFunctions.initCityState (cognitive 17) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:31— CityStateFunctions.initCityState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CapitalConnectionsFinder.find (cognitive 17) core/src/com/unciv/logic/civilization/transients/CapitalConnectionsFinder.kt:45— CapitalConnectionsFinder.find has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CivInfoTransientCache.setTransients (cognitive 17) core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt:58— CivInfoTransientCache.setTransients has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Github.rewriteModOptions (cognitive 17) core/src/com/unciv/logic/github/Github.kt:193— Github.rewriteModOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapGenTileData.evaluate (cognitive 17) core/src/com/unciv/logic/map/mapgenerator/mapregions/MapGenTileData.kt:43— MapGenTileData.evaluate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartNormalizer.addProductionBonuses (cognitive 17) core/src/com/unciv/logic/map/mapgenerator/mapregions/StartNormalizer.kt:139— StartNormalizer.addProductionBonuses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StrategicBonusResourcePlacementLogic.placeMinorDepositsOnLand (cognitive 17) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:219— StrategicBonusResourcePlacementLogic.placeMinorDepositsOnLand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiVersion.detect (cognitive 17) core/src/com/unciv/logic/multiplayer/ApiVersion.kt:69— ApiVersion.detect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Spy.initiateCoup (cognitive 17) core/src/com/unciv/models/Spy.kt:272— Spy.initiateCoup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ruleset.mergeTechnologies (cognitive 17) core/src/com/unciv/models/ruleset/Ruleset.kt:340— Ruleset.mergeTechnologies has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, match/switch 2 (3 pts), loops 2 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.addResourceErrors (cognitive 17) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:364— BaseRulesetValidator.addResourceErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.addVictoryTypeErrors (cognitive 17) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:544— BaseRulesetValidator.addVictoryTypeErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RulesetValidator.addModOptionsErrors (cognitive 17) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:288— RulesetValidator.addModOptionsErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextSimilarityKt.getTextDistance (cognitive 17) core/src/com/unciv/models/ruleset/validation/TextSimilarity.kt:27— TextSimilarityKt.getTextDistance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkinCache.loadSkinConfigs (cognitive 17) core/src/com/unciv/models/skins/SkinCache.kt:40— SkinCache.loadSkinConfigs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (5 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkinStrings.getUiBackground (cognitive 17) core/src/com/unciv/models/skins/SkinStrings.kt:50— SkinStrings.getUiBackground has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 4, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CityButton.updateHiddenUnitMarkers (cognitive 17) core/src/com/unciv/ui/components/tilegroups/citybutton/CityButton.kt:176— CityButton.updateHiddenUnitMarkers has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 4 (5 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileLayerFeatures.updateRoadImages (cognitive 17) core/src/com/unciv/ui/components/tilegroups/layers/TileLayerFeatures.kt:22— TileLayerFeatures.updateRoadImages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortableGrid.updateDetails (cognitive 17) core/src/com/unciv/ui/components/widgets/SortableGrid.kt:182— SortableGrid.updateDetails has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildingDescriptions.addBuildingDifferences (cognitive 17) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:133— BuildingDescriptions.addBuildingDifferences has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BuildingDescriptions.getUniquesStrings (cognitive 17) core/src/com/unciv/ui/objectdescriptions/BuildingDescriptions.kt:268— BuildingDescriptions.getUniquesStrings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConstructionsTable.getQueueEntry (cognitive 17) core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt:413— CityConstructionsTable.getQueueEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CityStateDiplomacyTable.getCityStateDiplomacyTable (cognitive 17) core/src/com/unciv/ui/screens/diplomacyscreen/CityStateDiplomacyTable.kt:37— CityStateDiplomacyTable.getCityStateDiplomacyTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MajorCivDiplomacyTable.getMajorCivDiplomacyTable (cognitive 17) core/src/com/unciv/ui/screens/diplomacyscreen/MajorCivDiplomacyTable.kt:44— MajorCivDiplomacyTable.getMajorCivDiplomacyTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapEditorViewTab.tileClickHandler (cognitive 17) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt:176— MapEditorViewTab.tileClickHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiplayerHelpers.buildDescriptionText (cognitive 17) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerHelpers.kt:39— MultiplayerHelpers.buildDescriptionText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitPresenter.updateWhenNeeded (cognitive 17) core/src/com/unciv/ui/screens/worldscreen/unit/presenter/UnitPresenter.kt:128— UnitPresenter.updateWhenNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BackwardCompatibility.removeTechAndPolicies (cognitive 16) core/src/com/unciv/logic/BackwardCompatibility.kt:135— BackwardCompatibility.removeTechAndPolicies has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameStarter.chooseCivilizations (cognitive 16) core/src/com/unciv/logic/GameStarter.kt:248— GameStarter.chooseCivilizations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConstructionAutomation.getOnetimeUniqueBonuses (cognitive 16) core/src/com/unciv/logic/automation/city/ConstructionAutomation.kt:282— ConstructionAutomation.getOnetimeUniqueBonuses has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), match/switch 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiplomacyAutomation.checkMilitaryPresenceNearBorder (cognitive 16) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:499— DiplomacyAutomation.checkMilitaryPresenceNearBorder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WorkerAutomation.isAutomationWorkableTile (cognitive 16) core/src/com/unciv/logic/automation/unit/WorkerAutomation.kt:292— WorkerAutomation.isAutomationWorkableTile has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Battle.movePreparingAttack (cognitive 16) core/src/com/unciv/logic/battle/Battle.kt:52— Battle.movePreparingAttack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Battle.triggerCombatUniques (cognitive 16) core/src/com/unciv/logic/battle/Battle.kt:256— Battle.triggerCombatUniques has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityConstructions.validateInProgressConstructions (cognitive 16) core/src/com/unciv/logic/city/CityConstructions.kt:472— CityConstructions.validateInProgressConstructions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyManager.adopt (cognitive 16) core/src/com/unciv/logic/civilization/managers/PolicyManager.kt:241— PolicyManager.adopt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TechManager.obsoleteOldUnits (cognitive 16) core/src/com/unciv/logic/civilization/managers/TechManager.kt:383— TechManager.obsoleteOldUnits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxuryResourcePlacementLogic.placeLuxuriesAtMajorCivStartLocations (cognitive 16) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/LuxuryResourcePlacementLogic.kt:380— LuxuryResourcePlacementLogic.placeLuxuriesAtMajorCivStartLocations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapUnit.updateVisibleTiles (cognitive 16) core/src/com/unciv/logic/map/mapunit/MapUnit.kt:848— MapUnit.updateVisibleTiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitActionModifiers.canSpendStatsCost (cognitive 16) core/src/com/unciv/logic/map/mapunit/actions/UnitActionModifiers.kt:55— UnitActionModifiers.canSpendStatsCost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitActionModifiers.getSideEffectString (cognitive 16) core/src/com/unciv/logic/map/mapunit/actions/UnitActionModifiers.kt:175— UnitActionModifiers.getSideEffectString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PathingMap.fetchCache (cognitive 16) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:101— PathingMap.fetchCache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AStarPathfinder.findDamageFreeAnchor (cognitive 16) core/src/com/unciv/logic/map/pathingmap/PathingMapAStarPathfinder.kt:132— AStarPathfinder.findDamageFreeAnchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TradeEvaluation.isTradeValid (cognitive 16) core/src/com/unciv/logic/trade/TradeEvaluation.kt:27— TradeEvaluation.isTradeValid has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Building.matchesSingleFilter (cognitive 16) core/src/com/unciv/models/ruleset/Building.kt:523— Building.matchesSingleFilter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Building.isStatRelated (cognitive 16) core/src/com/unciv/models/ruleset/Building.kt:544— Building.isStatRelated has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRulesetValidator.checkBuilding (cognitive 16) core/src/com/unciv/models/ruleset/validation/BaseRulesetValidator.kt:51— BaseRulesetValidator.checkBuilding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CityTileGroup.update (cognitive 16) core/src/com/unciv/ui/components/tilegroups/CityTileGroup.kt:30— CityTileGroup.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AtlasPreview.logMissingAtlas (cognitive 16) core/src/com/unciv/ui/images/AtlasPreview.kt:89— AtlasPreview.logMissingAtlas has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniStatsTable.update (cognitive 16) core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:420— MiniStatsTable.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupRenderer.renderTo (cognitive 16) core/src/com/unciv/ui/screens/civilopediascreen/MarkupRenderer.kt:52— MarkupRenderer.renderTo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobalPoliticsOverviewTable.getPoliticsOfCivTable (cognitive 16) core/src/com/unciv/ui/screens/overviewscreen/GlobalPoliticsOverviewTable.kt:194— GlobalPoliticsOverviewTable.getPoliticsOfCivTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitOverviewTabHelpers.updatePromotionsTable (cognitive 16) core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTabHelpers.kt:119— UnitOverviewTabHelpers.updatePromotionsTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BattleTable.update (cognitive 16) core/src/com/unciv/ui/screens/worldscreen/bottombar/BattleTable.kt:67— BattleTable.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MinimapTile.updateCityCircle (cognitive 16) core/src/com/unciv/ui/screens/worldscreen/minimap/MinimapTile.kt:107— MinimapTile.updateCityCircle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorldScreenTopBarResources.update (cognitive 16) core/src/com/unciv/ui/screens/worldscreen/topbar/WorldScreenTopBarResources.kt:81— WorldScreenTopBarResources.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopLauncher.main (cognitive 16) desktop/src/com/unciv/app/desktop/DesktopLauncher.kt:40— DesktopLauncher.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WebFont.getModFonts (cognitive 16) web/src/main/kotlin/com/unciv/app/web/WebFont.kt:113— WebFont.getModFonts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parseCommits (cognitive 16) .github/workflows/incrementVersionAndChangelog.mjs:97— parseCommits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 116, 145). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:416— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:416-545 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:548-605 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:608-653 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:656-697 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:705-750 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:786-831 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:834-951 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:954-1087 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1090-1143 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:71— core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:71-117 | core/src/com/unciv/logic/map/mapgenerator/MapElevationGenerator.kt:119-161 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt:451— core/src/com/unciv/models/ruleset/Building.kt:451-495 | core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:328-371 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:173— core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:173-204 | core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt:277-307 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) core/src/com/unciv/models/ruleset/Building.kt:162— core/src/com/unciv/models/ruleset/Building.kt:162-191 | core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt:40-75 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:50— core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:50-74 | core/src/com/unciv/logic/automation/civilization/DeclareWarTargetAutomation.kt:79-103 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:387— core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:387-421 | core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:423-479 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) core/src/com/unciv/logic/map/mapunit/actions/UnitActionsReligion.kt:18— core/src/com/unciv/logic/map/mapunit/actions/UnitActionsReligion.kt:18-46 | core/src/com/unciv/logic/map/mapunit/actions/UnitActionsReligion.kt:48-75 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:202— core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:202-240 | core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:247-286 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) core/src/com/unciv/logic/map/MapPathing.kt:85— core/src/com/unciv/logic/map/MapPathing.kt:85-105 | core/src/com/unciv/logic/map/MapPathing.kt:118-140 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) core/src/com/unciv/logic/files/UncivFiles.kt:251— core/src/com/unciv/logic/files/UncivFiles.kt:251-270 | core/src/com/unciv/logic/files/UncivFiles.kt:464-483 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) core/src/com/unciv/ui/screens/devconsole/CliInput.kt:62— core/src/com/unciv/ui/screens/devconsole/CliInput.kt:62-71 | core/src/com/unciv/ui/screens/devconsole/CliInput.kt:113-122 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:541— core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:541-562 | core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:565-586 | core/src/com/unciv/logic/map/pathingmap/PathingMap.kt:589-606 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) core/src/com/unciv/models/ruleset/nation/Nation.kt:165— core/src/com/unciv/models/ruleset/nation/Nation.kt:165-175 | core/src/com/unciv/models/ruleset/tile/Terrain.kt:178-187 | core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:440-449 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt:268— core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt:268-272 | core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt:275-278 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:139— core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:139-154 | core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:163-178 | core/src/com/unciv/ui/screens/multiplayerscreens/MultiplayerScreen.kt:180-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:202— core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:202-217 | core/src/com/unciv/logic/map/mapgenerator/resourceplacement/StrategicBonusResourcePlacementLogic.kt:292-308 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) core/src/com/unciv/ui/screens/cityscreen/CityMapHolder.kt:13— core/src/com/unciv/ui/screens/cityscreen/CityMapHolder.kt:13-27 | core/src/com/unciv/ui/screens/mapeditorscreen/EditorMapHolder.kt:58-71 | core/src/com/unciv/ui/screens/worldscreen/worldmap/WorldMapHolder.kt:85-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:841— core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt:841-844 | core/src/com/unciv/ui/images/ImageGetter.kt:522-524 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) core/src/com/unciv/logic/city/City.kt:336— core/src/com/unciv/logic/city/City.kt:336-340 | core/src/com/unciv/logic/civilization/Civilization.kt:1062-1068 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) core/src/com/unciv/models/ruleset/Building.kt:472— core/src/com/unciv/models/ruleset/Building.kt:472-488 | core/src/com/unciv/models/ruleset/unit/BaseUnit.kt:348-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/Building.kt:472` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:806— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:806-821 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:839-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:806` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:224— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:224-238 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:315-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–16 lines × 2) core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:86— core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:86-95 | core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorWesnothImporter.kt:89-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–15 lines × 2) core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:401— core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:401-415 | core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:464-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:401` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:464` calls `getCivUnits` and `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt:401` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) core/src/com/unciv/models/skins/SkinStrings.kt:56— core/src/com/unciv/models/skins/SkinStrings.kt:56-69 | core/src/com/unciv/models/skins/SkinStrings.kt:83-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/skins/SkinStrings.kt:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–12 lines × 2) core/src/com/unciv/logic/map/TileMap.kt:339— core/src/com/unciv/logic/map/TileMap.kt:339-350 | core/src/com/unciv/logic/map/TileMap.kt:353-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/map/TileMap.kt:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 3) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:181— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:181-188 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:222-229 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:313-321 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:311` calls `getCivilizationOrNull` and `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:180` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–12 lines × 3) core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:99— core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:99-110 | core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:160-171 | core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:187-193 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) core/src/com/unciv/logic/civilization/Civilization.kt:669— core/src/com/unciv/logic/civilization/Civilization.kt:669-675 | core/src/com/unciv/logic/civilization/Civilization.kt:694-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/logic/civilization/Civilization.kt:669` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5–8 lines × 3) core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:267— core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:267-274 | core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:276-283 | core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:284-288 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:264` calls `add`, `row` and `core/src/com/unciv/ui/screens/cityscreen/CityStatsTable.kt:273` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:1141— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:1141-1147 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:1163-1168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:1141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:257— core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:257-274 | core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:345-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:257` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:277` calls `getCivilizationOrNull` and `core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:365` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (72 lines × 3) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:426— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:426-497 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:844-915 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:964-1035 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 2) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:621— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:621-630 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:665-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 3) core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:802— core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:802-808 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:922-928 | core/src/com/unciv/ui/screens/basescreen/TextureArraySpriteBatch.java:1112-1120 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Off the main sequence: .:core — .:core: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplicated block (24 lines × 2 locations) web/validation/json-roundtrip/run.cjs:2— web/validation/json-roundtrip/run.cjs:2 · web/validation/reflection-field/run.cjs:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (9 lines × 2 locations) REDACTED:4— REDACTED:4 · REDACTED:4 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (8 lines × 2 locations) web/validation/http-fetch-engine/run.cjs:91— web/validation/http-fetch-engine/run.cjs:91 · web/validation/http-fetch-engine/run.cjs:99 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (5 lines × 2 locations) web/validation/http-fetch-engine/run.cjs:57— web/validation/http-fetch-engine/run.cjs:57 · web/validation/http-fetch-engine/run.cjs:68 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 26, cognitive 18) · ×1
Complex function main (cyclomatic 26, cognitive 18) web/validation/http-fetch-engine/browser-fetch-contract.cjs:22— main has cyclomatic complexity 26 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 15, cognitive 14) REDACTED:67— (anonymous) has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetch (cyclomatic 11, cognitive 10) web/validation/http-fetch-engine/run.cjs:18— fetch has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~175 LoC) web/validation/http-fetch-engine/run.cjs— no import path from any entry point (4 application, 2 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~25 LoC) web/validation/json-roundtrip/run.cjs— no import path from any entry point (4 application, 2 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~24 LoC) web/validation/reflection-field/run.cjs— no import path from any entry point (4 application, 2 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X13 · Undrained process stream· Redirected process stream is never drained (deadlock) · ×1
Redirected process stream is never drained (deadlock) desktop/src/com/unciv/app/desktop/SystemUtils.kt:80— The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
X27 · Collection changed while being enumerated· Collection is structurally changed while it is being enumerated · ×1
Collection is structurally changed while it is being enumerated core/src/com/unciv/logic/multiplayer/apiv2/ApiV2.kt:238— `gameDetails.keys` is a live view over `gameDetails` and shares its modification count; it is walked by the loop on line 238, and line 240 calls `gameDetails.remove` on `gameDetails` inside the loop body — a structural change to a `LinkedHashMap`. The loop's hidden iterator is fail-fast, so its next `next()` throws `ConcurrentModificationException`: every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen.
Duplicated predicate REDACTED:25— `context.pages()[0] || await context.newPage()` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:18— `process.env.UNCIV_PREVIEW_URL || 'http://127.0.0.1:18081/'` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:21— `process.platform === 'win32' && fs.existsSync('C:/Program Files/Google/Chrome/Application/chrome.exe')` appears character-identically in 3 files — REDACTED, REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate settings.gradle.kts:23— `!teavmSource.isAbsolute || !teavmSource.isDirectory` appears character-identically in 2 files — settings.gradle.kts, web/validation/http-fetch-engine/settings.gradle.kts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/map/AStar.kt:116— `!tilesReached.containsKey(destination) && !hasEnded()` appears character-identically in 2 files — core/src/com/unciv/logic/map/AStar.kt, core/src/com/unciv/logic/map/BFS.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/civilization/managers/PolicyManager.kt:268— `!unique.isTriggerable || unique.hasTriggerConditional() || !unique.conditionalsApply(civInfo.state)` appears character-identically in 2 files — core/src/com/unciv/logic/civilization/managers/PolicyManager.kt, core/src/com/unciv/logic/civilization/managers/TechManager.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/battle/Battle.kt:389— `attacker.isRanged() && !attacker.isAirUnit()` appears character-identically in 2 files — core/src/com/unciv/logic/battle/Battle.kt, core/src/com/unciv/logic/battle/BattleDamage.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/automation/Automation.kt:145— `city.isWeLoveTheKingDayActive() && city.civ.getHappiness() >= 0` appears character-identically in 2 files — core/src/com/unciv/logic/automation/Automation.kt, core/src/com/unciv/logic/city/CityStats.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/battle/BattleDamage.kt:108— `civInfo.cities.isEmpty() || civInfo.getCapital() == null` appears character-identically in 4 files — core/src/com/unciv/logic/battle/BattleDamage.kt, core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt, core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt, core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt:197— `civInfo.cities.isEmpty() || otherCiv.cities.isEmpty()` appears character-identically in 2 files — core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt, core/src/com/unciv/logic/civilization/transients/CivInfoTransientCache.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt:529— `civInfo.isAI() || UncivGame.Current.worldScreen?.autoPlay?.isAutoPlayingAndFullAutoPlayAI() == true` appears character-identically in 2 files — core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt, core/src/com/unciv/ui/components/MayaCalendar.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt:42— `civInfo.isCityState && otherCiv.isMajorCiv` appears character-identically in 2 files — core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt, core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/ui/objectdescriptions/DescriptionHelpers.kt:53— `colorConsumesResources && unique.type == UniqueType.ConsumesResources` appears character-identically in 2 files — core/src/com/unciv/ui/objectdescriptions/DescriptionHelpers.kt, core/src/com/unciv/ui/objectdescriptions/FormattedLineListBuilder.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/ui/popups/CityScreenConstructionMenu.kt:97— `construction is Building && construction.hasCreateOneImprovementUnique()` appears character-identically in 2 files — core/src/com/unciv/ui/popups/CityScreenConstructionMenu.kt, core/src/com/unciv/ui/screens/cityscreen/CityConstructionsTable.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/city/CityConstructions.kt:604— `construction is Building && construction.isWonder` appears character-identically in 2 files — core/src/com/unciv/logic/city/CityConstructions.kt, core/src/com/unciv/logic/city/managers/CityTurnManager.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/automation/civilization/DeclareWarPlanEvaluator.kt:161— `diploManager.hasFlag(DiplomacyFlags.WaryOf) && diploManager.getFlag(DiplomacyFlags.WaryOf) < 0` appears character-identically in 2 files — core/src/com/unciv/logic/automation/civilization/DeclareWarPlanEvaluator.kt, core/src/com/unciv/logic/automation/unit/UnitAutomation.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/ui/screens/multiplayerscreens/AddFriendScreen.kt:56— `friendNameTextField.text.isEmpty() && friend.name.isNotEmpty()` appears character-identically in 2 files — core/src/com/unciv/ui/screens/multiplayerscreens/AddFriendScreen.kt, core/src/com/unciv/ui/screens/multiplayerscreens/EditFriendScreen.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/ui/images/AtlasPreview.kt:110— `innerException.cause != null && innerException.cause !== innerException` appears character-identically in 2 files — core/src/com/unciv/ui/images/AtlasPreview.kt, desktop/src/com/unciv/app/desktop/ImagePacker.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/map/tile/TileNormalizer.kt:41— `it == tile.baseTerrain || tile.terrainFeatures.contains(it)` appears character-identically in 2 files — core/src/com/unciv/logic/map/tile/TileNormalizer.kt, core/src/com/unciv/models/ruleset/unique/UniqueTriggerActivation.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/models/ruleset/Building.kt:463— `it.cityConstructions.containsBuildingOrEquivalent(building) && it.matchesFilter(cityFilter)` appears character-identically in 2 files — core/src/com/unciv/models/ruleset/Building.kt, core/src/com/unciv/models/ruleset/unit/BaseUnit.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/city/City.kt:736— `it.getModifiers(trigger).any(triggerFilter) && it.conditionalsApply(gameContext)` appears character-identically in 2 files — core/src/com/unciv/logic/city/City.kt, core/src/com/unciv/logic/civilization/Civilization.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/automation/civilization/ThreatManager.kt:144— `it.isCityCenter() && it.getCity()!!.owningCiv().isAtWarWith(civ)` appears character-identically in 2 files — core/src/com/unciv/logic/automation/civilization/ThreatManager.kt, core/src/com/unciv/logic/automation/unit/UnitAutomation.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/GameStarter.kt:258— `it.isMajorCiv && !it.hasUnique(UniqueType.WillNotBeChosenForNewGames)` appears character-identically in 2 files — core/src/com/unciv/logic/GameStarter.kt, core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/models/ruleset/Building.kt:476— `it.matchesFilter(cityFilter) && !it.isPuppet && !it.cityConstructions.containsBuildingOrEquivalent(building)` appears character-identically in 2 files — core/src/com/unciv/models/ruleset/Building.kt, core/src/com/unciv/models/ruleset/unit/BaseUnit.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt:329— `it.religionManager.religion != null && it.religionManager.religionState >= ReligionState.Religion` appears character-identically in 2 files — core/src/com/unciv/logic/automation/civilization/ReligionAutomation.kt, core/src/com/unciv/logic/civilization/managers/ReligionManager.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Orphaned file core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/apiv2/ResponseStructs.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/apiv2/WebSocketStructs.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/event/EventBus.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file buildSrc/src/main/kotlin/AndroidImagePacker.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/models/skins/SkinStrings.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/apiv2/JsonSerializers.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/screens/pickerscreens/PickerPane.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/components/ZoomGestureListener.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/screens/worldscreen/status/MultiplayerStatusButton.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/chat/ChatStore.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/components/extensions/FormattingExtensions.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/models/ruleset/validation/TextSimilarity.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/models/skins/SkinCache.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file desktop/src/com/unciv/app/desktop/CreateGameFromSettings.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/screens/multiplayerscreens/ViewFriendsListScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/screens/multiplayerscreens/AddFriendScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/screens/worldscreen/unit/AutoPlay.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/components/widgets/BorderedTable.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/ui/popups/AskTextPopup.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/apiv2/AuthHelper.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/com/unciv/logic/multiplayer/apiv2/RequestStructs.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 57 significant file(s) lose their only recent owner: core/src/com/unciv/models/ruleset/unique/DeprecatedUniques.kt, core/src/com/unciv/ui/screens/pickerscreens/PolicyPickerScreen.kt, core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt, core/src/com/unciv/view/MapUnitView.kt, core/src/com/unciv/view/TileView.kt, core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt, core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorScreen.kt, core/src/com/unciv/view/CityView.kt (+49 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 20 significant file(s) lose their only recent owner: core/src/com/unciv/models/translations/TranslationExtensions.kt, core/src/com/unciv/ui/screens/civilopediascreen/FormattedLine.kt, core/src/com/unciv/logic/civilization/managers/quests/QuestImplementation.kt, core/src/com/unciv/ui/components/widgets/UncivTextField.kt, core/src/com/unciv/ui/screens/basescreen/StageMouseOverDebug.kt, core/src/com/unciv/logic/map/CarrierSlotMatcher.kt, core/src/com/unciv/models/ruleset/nation/Difficulty.kt, core/src/com/unciv/models/ruleset/Speed.kt (+12 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: core/src/com/unciv/logic/map/OdMapExport.kt, core/src/com/unciv/logic/map/OdMapImport.kt, core/src/com/unciv/ui/screens/mapeditorscreen/MapEditorOdImporter.kt, core/src/com/unciv/logic/map/OdTerrain.kt. Pair on, review, or document these before any departure.
Silent fallback default in catch desktop/src/com/unciv/app/desktop/SystemUtils.kt:93— `getWinVer` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch desktop/src/com/unciv/app/desktop/SystemUtils.kt:113— `getLinuxDistro` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (88 single-owned of 559 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 559 of the 738 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: core/src/com/unciv/logic/battle/AttackRecorder.kt, core/src/com/unciv/logic/battle/AttackEvent.kt, core/src/com/unciv/ui/screens/worldscreen/TutorialTaskTable.kt, core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorModsTab.kt, core/src/com/unciv/ui/screens/modmanager/ModDecoratedButton.kt, core/src/com/unciv/ui/components/fonts/ModFonts.kt, desktop/src/com/unciv/app/desktop/DiscordUpdater.kt.
D21 · Naming Consistency· `uncivRepoURL` spells `URL` where 30 names in the project spell it `Url` · ×1
`uncivRepoURL` spells `URL` where 30 names in the project spell it `Url` core/src/com/unciv/Constants.kt:142— 30 of 32 names in project core spell the token `Url` (30 of 32; unit: names in project core containing `Url`). Peers: IdChecker.uncivUrlPrefix (core/src/com/unciv/logic/IdChecker.kt:33); IdChecker.checkAndReturnIdFromUrl (core/src/com/unciv/logic/IdChecker.kt:61); Github.getPreviewImageOrNull(modUrl) (core/src/com/unciv/logic/github/Github.kt:125); Github.getPreviewImageOrNull(avatarUrl) (core/src/com/unciv/logic/github/Github.kt:125); GithubAPI.baseUrl (core/src/com/unciv/logic/github/GithubAPI.kt:58). Rename to `uncivRepoUrl`. [rule N6]
D21 · Naming Consistency· `wikiURL` spells `URL` where 30 names in the project spell it `Url` · ×1
`wikiURL` spells `URL` where 30 names in the project spell it `Url` core/src/com/unciv/Constants.kt:144— 30 of 32 names in project core spell the token `Url` (30 of 32; unit: names in project core containing `Url`). Peers: IdChecker.uncivUrlPrefix (core/src/com/unciv/logic/IdChecker.kt:33); IdChecker.checkAndReturnIdFromUrl (core/src/com/unciv/logic/IdChecker.kt:61); Github.getPreviewImageOrNull(modUrl) (core/src/com/unciv/logic/github/Github.kt:125); Github.getPreviewImageOrNull(avatarUrl) (core/src/com/unciv/logic/github/Github.kt:125); GithubAPI.baseUrl (core/src/com/unciv/logic/github/GithubAPI.kt:58). Rename to `wikiUrl`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 10 project(s) overshoot their size bounds, lowering Project Cohesion to 8.0/10. The most over is `core` (121923 LoC, 3681 module-visible types across 91 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 22 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt, core/src/com/unciv/logic/multiplayer/apiv2/ResponseStructs.kt, core/src/com/unciv/logic/multiplayer/apiv2/WebSocketStructs.kt, core/src/com/unciv/logic/event/EventBus.kt, buildSrc/src/main/kotlin/AndroidImagePacker.kt, core/src/com/unciv/models/skins/SkinStrings.kt, core/src/com/unciv/logic/multiplayer/apiv2/JsonSerializers.kt, core/src/com/unciv/ui/screens/pickerscreens/PickerPane.kt (and 14 more) (23 orphaned of 559 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 559 of the 738 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Logging is not universal — Only 5/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `web/validation/desktop-network-contract`, `web/validation/http-fetch-engine`, `web/validation/json-roundtrip`, `web/validation/reflection-field`.
No SAST REDACTED:16— No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 11 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
Not-null assertions (`!!`) override null safety — ~10.3 `!!` not-null assertions per 1k Kotlin product lines — 1490 across the 144024 line(s) of the 718 Kotlin file(s) read (generated, test and sample code not counted). Densest: core/src/com/unciv/logic/simulation/Simulation.kt (82), core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt (43), core/src/com/unciv/logic/automation/civilization/DiplomacyAutomation.kt (37). Each one tells the compiler to trust the author about null and becomes a `NullPointerException` the first time the author is wrong. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 51 file(s) — `core/src/com/unciv/logic/civilization/Civilization.kt`, `core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt`, `core/src/com/unciv/logic/github/GithubAPI.kt`, `core/src/com/unciv/logic/map/HexMath.kt`, `core/src/com/unciv/logic/map/mapgenerator/MapGenerationRandomness.kt`, … (+46 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
0
—
Run 01a1d656-e611-7ee3-bd44-be2c67f2b71c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 112 · Warnings: 957 · Recommendations: 82 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 13-11-2026 @ 19:16 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.