Open source clone of Theme Hospital
This report summarizes scanner evidence for CorsixTH/CorsixTH, a Lua project with 4,627 GitHub stars. SynthScan examined 197,168 lines of code across 505 source files, recording 126 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 0.7 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 110 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 31 finding(s).
Which changes need focused human review? 126 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 126 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | CMakeLists.txt | 1 | # Cmake File for CorsixTH | COMMENT |
| LOW | SpriteEncoder/tokens.h | 81 | #else /* ! YYPARSE_PARAM */ | COMMENT |
| LOW | SpriteEncoder/scanner.cpp | 1 | #line 2 "scanner.cpp" | COMMENT |
| LOW | SpriteEncoder/scanner.cpp | 61 | #endif | COMMENT |
| LOW | SpriteEncoder/scanner.cpp | 81 | #define UINT16_MAX (65535U) | COMMENT |
| LOW | SpriteEncoder/scanner.cpp | 141 | #define YY_END_OF_BUFFER_CHAR 0 | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 81 | # define YY_NULL 0 | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 141 | int yyparse (); | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 181 | #endif | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 201 | #endif | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 241 | COMMENT | |
| LOW | SpriteEncoder/parser.cpp | 261 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 281 | # else | COMMENT |
| LOW | SpriteEncoder/parser.cpp | 641 | #endif | COMMENT |
| LOW | CorsixTH/resource.h | 1 | //{{NO_DEPENDENCIES}} | COMMENT |
| LOW | CorsixTH/Bitmap/readme.txt | 21 | #10 - fullscreen_border_topleft.bmp | COMMENT |
| LOW | CorsixTH/CppTest/CMakeLists.txt | 1 | # MIT License | COMMENT |
| LOW | CorsixTH/SrcUnshared/main.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/midi_player.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/lua.hpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/lua.hpp | 61 | COMMENT | |
| LOW | CorsixTH/Src/th_gfx_font.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_lua_map.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_map.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_map.h | 201 | link_list entities; | COMMENT |
| LOW | CorsixTH/Src/th_lua_gfx.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_lua_gfx.cpp | 381 | COMMENT | |
| LOW | CorsixTH/Src/th_lua_gfx.cpp | 401 | //! <dd>A table with fields "offset_x", "offset_y" and "color". The color | COMMENT |
| LOW | CorsixTH/Src/th_gfx.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_lua.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_lua_midi.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/random.c | 41 | email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) | COMMENT |
| LOW | CorsixTH/Src/sdl_core.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_gfx.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_gfx.h | 361 | unsigned int flags; ///< Flags of the frame. Bit 0=start of animation. | COMMENT |
| LOW | CorsixTH/Src/th_lua_sound.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_pathfind.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_gfx_font.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_gfx_sdl.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_sound.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_sound.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_sound.h | 181 | //! | COMMENT |
| LOW | CorsixTH/Src/th_sound.h | 201 | COMMENT | |
| LOW | CorsixTH/Src/lua_sdl.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_lua.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/iso_fs.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th.h | 41 | //! \brief Theme Hospital localised string list | COMMENT |
| LOW | CorsixTH/Src/persist_lua.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/main.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_movie.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/sdl_audio.cpp | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 21 | */ | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 41 | COMMENT | |
| LOW | CorsixTH/Src/th_movie.h | 161 | void reset(); | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 181 | //! | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 201 | //! \remark If the movie_picture_buffer is not allocated it cannot be read | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 261 | //! Destroy the packet queue. | COMMENT |
| LOW | CorsixTH/Src/th_movie.h | 321 | COMMENT | |
| LOW | CorsixTH/Src/th_movie.h | 361 | COMMENT | |
| LOW | CorsixTH/Src/th_movie.h | 381 | COMMENT | |
| 21 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | CorsixTH/Bitmap/mkraw.lua | 38 | print("Error: Extension must must be .bmp") | CODE |
| MEDIUM | CorsixTH/Lua/world.lua | 1019 | print("Error while autosaving game: " .. err) | CODE |
| MEDIUM | CorsixTH/Lua/app.lua | 1732 | print("Error loading " .. dir .. file .. ":\n" .. tostring(result)) | CODE |
| MEDIUM | CorsixTH/Lua/graphics.lua | 124 | print("Error: An invalid custom graphics mapping file was found") | CODE |
| MEDIUM | CorsixTH/Lua/graphics.lua | 860 | print("Error when loading custom animations:\n" .. err) | CODE |
| MEDIUM | CorsixTH/Lua/strings.lua | 49 | print("Error loading languages" .. pathsep .. file .. ":\n" .. tostring(err)) | CODE |
| MEDIUM | CorsixTH/Lua/strings.lua | 120 | print("Error evaluating " .. filename .. ":\n" .. tostring(err)) | CODE |
| MEDIUM | CorsixTH/Lua/strings.lua | 342 | print("Error evaluating " .. self.language_chunks[chunk] .. ":\n" .. tostring(err)) | CODE |
| MEDIUM | CorsixTH/Lua/audio.lua | 297 | print("Error: Audio dump failed because info.csv couldn't be created and/or opened in the dump directory:" .. out_di | CODE |
| MEDIUM | CorsixTH/Lua/dialogs/tree_ctrl.lua | 288 | print("Error while fetching children for " .. self.path .. ": " .. err) | CODE |
| MEDIUM | CorsixTH/Lua/dialogs/resizables/lua_console.lua | 118 | print("Error while loading UserFunction:") | CODE |
| MEDIUM | CorsixTH/Lua/dialogs/resizables/lua_console.lua | 126 | print("Error while executing UserFunction:") | CODE |
| MEDIUM | scripts/sound-dat-repair.py | 74 | print(f"Error: Input file '{input_dat_path}' not found.", | CODE |
| MEDIUM | scripts/sound-dat-repair.py | 81 | print("Error: File is too small to be a valid sound archive.", | CODE |
| MEDIUM | scripts/sound-dat-repair.py | 92 | print(f"Error: Header position {header_position} out of bounds.", | CODE |
| MEDIUM | scripts/sound-dat-repair.py | 119 | print(f"Error: Table entry {i} out of bounds.", file=sys.stderr) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | CorsixTH/Luatest/spec/entities/machine_spec.lua | 37 | local function createMachineWithFakeInput() | CODE |
| LOW | CorsixTH/Luatest/spec/entities/object_spec.lua | 35 | local function createObjectWithFakeInput() | CODE |
| LOW | CorsixTH/Lua/world.lua | 374 | local function isDiseaseUsableForNewPatient(self, disease, hospital) | CODE |
| LOW | CorsixTH/Lua/world.lua | 2030 | local function setFootprintTilesPassable(passable) | CODE |
| LOW | CorsixTH/Lua/world.lua | 2113 | local function setFootprintTilesPassable(passable) | CODE |
| LOW | CorsixTH/Lua/world.lua | 2192 | local function setFootprintTilesPassable(passable) -- not used for SideObjects | CODE |
| LOW | CorsixTH/Lua/app.lua | 642 | local function revertToSupportedLanguage() | CODE |
| LOW | CorsixTH/Lua/window.lua | 1780 | local --[[persistable:window_drag_position_representation]] function getNicestPositionRepresentation(pos, scale, size, d | CODE |
| LOW | CorsixTH/Lua/epidemic.lua | 365 | local function getBaseReputationFromFine(fine_amount) | CODE |
| LOW | CorsixTH/Lua/persistance.lua | 74 | local function MakePermanentObjectsTable(inverted) | CODE |
| LOW | CorsixTH/Lua/humanoid_actions/die.lua | 115 | local function tryToUseHellDeathSpawnScenario(spawn_scenario) | CODE |
| LOW | CorsixTH/Lua/dialogs/edit_room.lua | 1293 | local function doorWallOffsetCalculations(x, y, wall) | CODE |
| LOW | CorsixTH/Lua/dialogs/resizables/map_editor.lua | 841 | local function computeCursorSpriteAtArea(minx, miny, maxx, maxy, dx, dy) | CODE |
| LOW | CorsixTH/Lua/dialogs/fullscreen/graphs.lua | 100 | local function computeVerticalValuePosition(graph_line, value) | CODE |
| LOW | CorsixTH/Lua/entities/object.lua | 447 | local function coordinatesAreInFootprint(object_footprint, xpos, ypos) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | CorsixTH/Lua/languages/danish.lua | 2560 | -- Don't forget to change all references in the code and other language files. | CODE |
| LOW | CorsixTH/Lua/languages/norwegian.lua | 3309 | -- Don't forget to change all references in the code and other language files. | CODE |
| LOW | CorsixTH/Lua/languages/original_strings.lua | 217 | -- Don't forget to change all references in the code and other language files. | CODE |
| LOW | CorsixTH/Lua/languages/finnish.lua | 2801 | -- Don't forget to change all references in the code and other language files. | CODE |
| LOW | CorsixTH/Lua/languages/hungarian.lua | 1434 | -- Don't forget to change all references in the code and other language files. | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/check_lua_classes.py | 41 | # Read the file while finding class definition lines. | COMMENT |
| LOW | .github/workflows/Linux.yml | 81 | # Check if there is bad whitespace. | COMMENT |
| LOW | .github/workflows/Linux.yml | 85 | # Check if there are lua classes with invalid/improper declarations. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | SpriteEncoder/decode.py | 103 | CODE | |
| LOW | scripts/check_lua_classes.py | 35 | CODE | |
| LOW | scripts/check_whitespace.py | 35 | CODE | |
| LOW | scripts/check_whitespace.py | 61 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/check_lua_classes.py | 62 | # Create a matcher for the '--- @class Foo: Bar' line that should exist. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | CorsixTH/Lua/dialogs/place_objects.lua | 955 | -- we need to check if the failure to get the distance is due to the presence of an object in the adjacent tile | CODE |