Skip to content

test(codeql): clear all 70 test-code CodeQL alerts (real fixes)#185

Merged
Prekzursil merged 1 commit into
mainfrom
feat/incorporate-editor-and-zero-codeql
Jun 27, 2026
Merged

test(codeql): clear all 70 test-code CodeQL alerts (real fixes)#185
Prekzursil merged 1 commit into
mainfrom
feat/incorporate-editor-and-zero-codeql

Conversation

@Prekzursil

Copy link
Copy Markdown
Owner

Drives code-scanning to 0. Fixes all 70 open CodeQL alerts in the test suite with real, behavior-preserving changes (no suppressions, no threshold changes). Production src/ and coverage scope are untouched, so the 100% line+branch .NET coverage gate is unaffected.

Rule breakdown: missed-using (14)→using var; useless-upcast (14)→default(T); useless-assignment (16)→drop dead locals/discard; dereferenced-may-be-null (18)→!.AsObject() / as T ?? throw; dispose/local-not-disposed (4)→using var; empty-catch (2)+catch-all (1)→specific catches w/ intent comments; linq/missed-select (1)→.Select().

The single src/ alert (cs/call-to-unmanaged-code: P/Invoke ReadProcessMemory in ProcessMemoryScanner) is dismissed as by-design (no managed cross-process memory-read API exists).

Local verification: dotnet build 0 errors; 1,306 modified-class tests pass, 0 failures. Full suite + nightly CodeQL rescan confirmed by CI.

…preserving)

Resolves all 70 open CodeQL alerts located in the test suite, with real fixes
(no suppressions, no threshold changes); production src and coverage scope are
untouched, so the 100% line+branch .NET coverage gate is unaffected.

- cs/missed-using-statement (14): manual try/finally Dispose -> `using var`.
- cs/useless-upcast (14): `(T)null` cast -> `default(T)` (preserves params-array
  element typing / overload selection; not a cast, so the alert clears).
- cs/useless-assignment-to-local (16): drop dead locals / discard, keep calls.
- cs/dereferenced-value-may-be-null (18): `... as JsonObject` -> `!.AsObject()`;
  other `as T` derefs guarded with `?? throw` so flow is provably non-null.
- cs/missed-using / cs/local-not-disposed / cs/dispose-not-called-on-throw (4):
  `using var` for accessor/CTS/freeze-service instances.
- cs/empty-catch-block (2) + cs/catch-of-all-exceptions (1): document intent /
  catch specific IOException + UnauthorizedAccessException for best-effort cleanup.
- cs/linq/missed-select (1): foreach immediate-map -> `.Select(...)`.

The 1 src alert (cs/call-to-unmanaged-code in ProcessMemoryScanner: P/Invoke
ReadProcessMemory) is dismissed as by-design via code-scanning (no managed
cross-process memory-read API exists).

Verified: solution builds with 0 errors; 1,306 modified-class tests pass.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@Prekzursil Prekzursil merged commit 8d4f296 into main Jun 27, 2026
9 checks passed
@Prekzursil Prekzursil deleted the feat/incorporate-editor-and-zero-codeql branch June 27, 2026 19:26
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.

1 participant