Bug (found via coverage wave 3, spikersoft-angular PR #551).
Boss.selectBossType(floor, rng) in projects/spikersoft/src/app/_components/_games/dungeon-crawler/models/boss.model.ts (~line 192) is an unfinished stub:
constbossTypesForFloor=[// Get 3 boss types for this floor
];constselectedType=bossTypesForFloor[Math.floor(rng()*bossTypesForFloor.length)];selectedType.name=this.translate(selectedType.translationKey);// TypeError: selectedType is undefined
bossTypesForFloor is always [], so selectedType is undefined and the next line throws Cannot set properties of undefined (setting name). The method can never succeed.
Currently dead — no caller (grep .selectBossType( finds none); the constructor uses the standalone selectRandomBossType(floor, rng) from boss-type.model.ts instead. So no runtime breakage today, but the method is a latent trap if anything ever calls it.
Fix: either delete the dead method, or implement it (populate bossTypesForFloor from getBossTypesForFloor(floor) and guard the empty case) and route the constructor through it.
Pinned as a characterization test in PR #551 (boss.model.spec.ts) asserting it currently throws, referencing this ticket; update when fixed.
**Bug (found via coverage wave 3, spikersoft-angular PR #551).**
`Boss.selectBossType(floor, rng)` in `projects/spikersoft/src/app/_components/_games/dungeon-crawler/models/boss.model.ts` (~line 192) is an unfinished stub:
```ts
const bossTypesForFloor = [
// Get 3 boss types for this floor
];
const selectedType = bossTypesForFloor[Math.floor(rng() * bossTypesForFloor.length)];
selectedType.name = this.translate(selectedType.translationKey); // TypeError: selectedType is undefined
```
`bossTypesForFloor` is always `[]`, so `selectedType` is `undefined` and the next line throws `Cannot set properties of undefined (setting name)`. The method can never succeed.
Currently **dead** — no caller (`grep .selectBossType(` finds none); the constructor uses the standalone `selectRandomBossType(floor, rng)` from `boss-type.model.ts` instead. So no runtime breakage today, but the method is a latent trap if anything ever calls it.
**Fix:** either delete the dead method, or implement it (populate `bossTypesForFloor` from `getBossTypesForFloor(floor)` and guard the empty case) and route the constructor through it.
Pinned as a characterization test in PR #551 (`boss.model.spec.ts`) asserting it currently throws, referencing this ticket; update when fixed.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug (found via coverage wave 3, spikersoft-angular PR #551).
Boss.selectBossType(floor, rng)inprojects/spikersoft/src/app/_components/_games/dungeon-crawler/models/boss.model.ts(~line 192) is an unfinished stub:bossTypesForFlooris always[], soselectedTypeisundefinedand the next line throwsCannot set properties of undefined (setting name). The method can never succeed.Currently dead — no caller (
grep .selectBossType(finds none); the constructor uses the standaloneselectRandomBossType(floor, rng)fromboss-type.model.tsinstead. So no runtime breakage today, but the method is a latent trap if anything ever calls it.Fix: either delete the dead method, or implement it (populate
bossTypesForFloorfromgetBossTypesForFloor(floor)and guard the empty case) and route the constructor through it.Pinned as a characterization test in PR #551 (
boss.model.spec.ts) asserting it currently throws, referencing this ticket; update when fixed.