Skip to content

fix: resolve all four CodeQL findings + align codeql.yml to Standards (build-mode: none) - #15

Merged
StuartMeeks merged 2 commits into
mainfrom
fix/codeql-source-findings
Aug 22, 2026
Merged

fix: resolve all four CodeQL findings + align codeql.yml to Standards (build-mode: none)#15
StuartMeeks merged 2 commits into
mainfrom
fix/codeql-source-findings

Conversation

@StuartMeeks

@StuartMeeks StuartMeeks commented Aug 22, 2026

Copy link
Copy Markdown
Owner

What

Resolves all four open CodeQL security-and-quality alerts with genuine fixes (no dismissals), and brings codeql.yml back in line with the updated NextIteration.Standards template.

Source/test findings — fixed in code

  • cs/complex-condition (SplashColors.cs) — the hand-rolled (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') hex-digit test is replaced by char.IsAsciiHexDigit(c), the canonical BCL method (available on both net8.0 and net10.0).
  • cs/local-not-disposed (SplashScreenTests.cs) — the two TestConsole instances are now disposed via using. TestConsole is IDisposable and both were leaking.

Generated-file findings — fixed by making the exclusion actually work

  • cs/missed-ternary-operator ×2, in xUnit v3's auto-generated obj/Release/**/XunitAutoGeneratedEntryPoint.cs. These can't be fixed in code (regenerated every build, already // <auto-generated>). The repo already carried paths-ignore: **/obj/**, but under an explicit dotnet build GitHub applies no path filter to a compiled language, so that exclusion was silently inert.
  • codeql.yml now uses build-mode: none, matching the updated §4.4 template verbatim. Buildless extraction honours paths-ignore, so the obj/ exclusion finally takes effect, and it reads source across all TFMs at once instead of one build's output. The Setup .NET / Restore / Build steps are removed.

Behaviour-preserving: no public API or rendered output changed.

Standards alignment

  • codeql.yml is now identical to templates/.github/workflows/codeql.yml.
  • ci.yml, dependabot-auto-merge.yml, Directory.Build.props, global.json verified against templates — no other drift.

Verification

  • dotnet build -c Release — clean, 0 warnings (TreatWarningsAsErrors on).
  • dotnet test -c Release — 80/80 pass on net8.0 and net10.0.
  • The two obj/ alerts will auto-close once the updated CodeQL workflow runs on main post-merge.

🤖 Generated with Claude Code

…ot-disposed)

Replace the hand-rolled hex-digit range check in SplashColors.ValidateHex with
char.IsAsciiHexDigit — same result, no complex condition, and the canonical BCL
method on both net8.0 and net10.0. Dispose the two TestConsole instances in
SplashScreenTests via `using`; TestConsole is IDisposable and both were leaking.

Behaviour-preserving: no public API or rendered output changed. The two remaining
open alerts are in xUnit's auto-generated obj/ entry point and are pending a
Standards-level codeql.yml change (paths-ignore is inert for built C#).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
{
var prev = AnsiConsole.Console;
var test = new TestConsole().Width(120);
using var test = new TestConsole().Width(120);
The explicit-build CodeQL workflow applied no path filter to the compiled C#,
so the repo's paths-ignore: **/obj/** was inert and the xUnit auto-generated
entry point in obj/ was analysed and flagged (two cs/missed-ternary-operator
alerts). The updated §4.4 template switches to build-mode: none, under which
buildless extraction honours paths-ignore, so the exclusion actually takes
effect — and it reads source across all TFMs at once instead of one build's
output. File is the template verbatim; Setup .NET / Restore / Build steps removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@StuartMeeks StuartMeeks changed the title fix: resolve CodeQL source findings (complex-condition, local-not-disposed) fix: resolve all four CodeQL findings + align codeql.yml to Standards (build-mode: none) Aug 22, 2026
@StuartMeeks
StuartMeeks merged commit f0574ea into main Aug 22, 2026
9 checks passed
@StuartMeeks
StuartMeeks deleted the fix/codeql-source-findings branch August 22, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants