FileNameSanitizer: hostile-name edge cases survive mutation (73% score)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
調査の方向性
Read Files/FileNameSanitizer.cs, the listed mutation survivors, and the relevant tests under tests/Lagebuch.Domain.Tests; first run make mutate PROJECT=Domain to inspect the report. Add a test for each listed hostile input and verify each test fails against its mutant. The issue also asks to raise the floor in tests/Lagebuch.Domain.Tests/stryker-config.json; done means the new tests cover the cases and the Domain mutation score floor is raised. An open linked pull request (#722) already covers this work.
索引モデルが issue の本文から書いたものです。
説明
The weekly mutation run (2026-10-21, run 39560645989) scores Files/FileNameSanitizer.cs at 73 %. That is low for code at the trust boundary: it cleans the file names a sync peer sends and the names read back from an .fwincident. Line numbers below are as of 058273e.
These survivors are hostile-input paths with no test:
| Line | Survivor | What goes untested |
|---|---|---|
| 61 | the IsNullOrWhiteSpace early return null removed |
TrySanitize(null). Without the guard, fileName.Trim() throws, so no test passes null. |
| 80 | TrySanitize(...) ?? fallback (no coverage) |
Sanitize returning its fallback when nothing usable is left, e.g. "..." or "" |
| 100 | <= MaxFileNameBytes → < |
a name of exactly 255 UTF-8 bytes being kept as is |
| 107, 110 | >= MaxFileNameBytes → >; the pathological branch (no coverage) |
an "extension" of 255 bytes or more. Without that branch, new byte[MaxFileNameBytes - extensionBytes] gets a negative size and throws. |
| 119 | flush: false → true |
a stem cut right at a surrogate pair. With flush: true, half an emoji is encoded as a replacement character. |
Line 68 (IndexOf(...) < 0 → <= 0) is equivalent on Linux, because the first invalid character there is \0, which IsHidden already drops. Leave it.
Reproduce
make mutate PROJECT=Domain
# report: StrykerOutput/Domain/reports/mutation-report.html, file Files/FileNameSanitizer.cs
Suggested approach
Follow AGENTS.md: write one test per row that replays the hostile name and fails against its mutant first:
null;- a name made only of dots or bidi overrides;
- a 255-byte name;
"a." + new string('x', 300);- a long stem of emoji cut at the limit.
Fixing these raises Domain's score. Raise its floor in tests/LageBuch.Domain.Tests/stryker-config.json in the same pull request.
- 主要言語
- C#
- スター
- 1
- フォーク
- 3
- 平均マージ
- 4時間 34分
- マージ済み PR(30日)
- 182
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeForFire/lagebuch のほかの issue
-
bug ux
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CodeForFire/lagebuch#714 ·
メンテナーはふだん 1 日以内に返信
-
bug ux
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CodeForFire/lagebuch#713 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
CodeForFire/lagebuch#405 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
CodeForFire/lagebuch#349 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
CodeForFire/lagebuch#348 ·
メンテナーはふだん 1 日以内に返信
CodeForFire/lagebuch の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
KnifeLemon/Filee#363 ·
メンテナーはふだん 1 日以内に返信
-
[CI] .trgen-ignore required for several grammars.対応中かも @kaby76 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
antlr/grammars-v4#5073 ·
メンテナーはふだん 1 日以内に返信
-
/api/oauth/introspect emits clientId and tokenType instead of RFC 7662's client_id and token_typeオープンbug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nightscout/nocturne#2317 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: Position intent set on a simple order is dropped when it becomes a bracket, OCO or OTO order対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alpacahq/alpaca-trade-api-csharp#903 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
joinrpg/joinrpg-net#5752 ·
メンテナーはふだん 1 日以内に返信