Repository navigation
fix: resolve security alerts and Sonar issues, prepare patch releases - #128
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SonarQube Cloud successThe SonarQube Cloud Quality Gate passed for this PR. Quality Gate status: OK
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Security fixes
All five alerts originate from website/package-lock.json and the @lhci/cli 0.15.1 dependency tree. Removing LHCI and regenerating the lockfile removes every affected package:
npm audit reports zero vulnerabilities, including development dependencies. npm ls extract-zip tmp uuid reports an empty tree.
Lighthouse migration
The workflow now invokes repository scripts backed by the official Lighthouse CLI. The collector clears stale output, runs each of the four configured routes three times, writes one JSON report per run, and fails immediately on CLI errors. The assertion script requires exactly three valid measurements for every route and category, calculates medians, writes the GitHub Actions summary, and enforces:
Missing report directories, absent reports, unexpected URLs, missing categories, non-numeric scores, incomplete run sets, and failed blocking gates all produce failures. The existing job/check name and always-uploaded report artifact are preserved.
Dependency automation
Dependabot now monitors npm dependencies in /website every Monday at 09:30 America/Sao_Paulo. Compatible minor and patch updates are grouped with the deps commit prefix; major updates remain separate for compatibility review. Existing NuGet, .NET SDK, GitHub Actions, and Roslyn constraints are unchanged.
SonarQube maintainability fixes
The seven requested
csharpsquid:S3776findings were refactored without suppressions or threshold changes:ToolOptions.TryParseMaximumComplexity: normalized aliases and delegated canonical parsing. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #94.BigONotationParser.TryParse: split notation families into focused parsers and retained short-circuit dispatch. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #126.ComparisonOptions.TryParse: extracted option and format parsing while preserving accepted arguments and errors. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #125.McpHostOptions.TryParse: extracted value reading, bounded validation, and root resolution. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #124.KnownOperationComplexityAnalyzer.TryAnalyzeDeferredPipeline: separated local resolution, invocation resolution, and plan composition while preserving conservativeUnknownbehavior. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #123.ComplexityMcpService.CreateSummary: reused deterministic member traversal and separated file counting. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #122.ComplexityMcpService.QueryMemberEvidenceAsync: reused the same traversal while preserving order, snapshot selection, and response contracts. Fixes [Sonar][HIGH][MAINTAINABILITY] Cognitive Complexity of methods should not be too high #121.Regression coverage was added for Big-O forms and comparison option contracts. Existing Analyzer characterization, CLI, MCP isolation/limits/cancellation/timeouts, package, compatibility, and performance coverage also passed. The five JavaScript findings previously reported on this PR were removed by simplifying the Lighthouse collector and summary code.
The final SonarQube Cloud analysis for this head passed its quality gate and reports zero open PR issues. The synchronized GitHub issues remain open for the normal merge/default-branch synchronization flow; they were not closed manually.
Release preparation
ComplexityAnalysis.Analyzers1.6.1, intended tagv1.6.1.ComplexityAnalysis.Tool1.0.1, intended tagtool-v1.0.1.ComplexityAnalysis.Mcp1.0.1, intended tagmcp-v1.0.1.All three versions were confirmed absent from NuGet.org and all three intended tags were confirmed absent locally and remotely. Package versioning remains independent. No target framework, Roslyn compatibility constraint, package publication, tag, Registry publication, GitHub Release, or merge was performed.
The Analyzer, Tool, and MCP manual workflow defaults now use the prepared versions. The MCP release notes were added in English and Brazilian Portuguese. The checked-in
.mcp/server.jsonintentionally remains at the currently published Registry version1.0.0; the protected MCP release workflow creates a versioned copy, validates equality with the package/tag, and updates the Official MCP Registry only after authorized NuGet publication.Validation
Local validation from the repository root:
dotnet restore ./ComplexityAnalysis.Analyzers.slnx --source https://api.nuget.org/v3/index.json- passed. The canonical restore without an explicit source was blocked only by a stale machine-level NuGet source, which was not modified.dotnet build ./ComplexityAnalysis.Analyzers.slnx --configuration Release --no-restore- passed with 0 errors.dotnet test ./ComplexityAnalysis.Analyzers.slnx --configuration Release --no-build- passed, 1,300/1,300 tests.ComplexityAnalysis.Analyzers.1.6.1.nupkg,ComplexityAnalysis.Tool.1.0.1.nupkg, andComplexityAnalysis.Mcp.1.0.1.nupkgwith the expected layouts and dependency metadata.complexity-analysis 1.0.1andcomplexity-mcp 1.0.1; the Analyzer assembly remained underanalyzers/dotnet/cs/with nolib/netstandard2.0/copy.npm audit- 0 vulnerabilities;npm ls extract-zip tmp uuid --all- empty.git diff --check- passed.Remote validation on the final head:
OK, zero open PR issues.Compatibility
The changes are patch-compatible: public APIs, analyzer diagnostic contracts and estimates, CLI arguments/exit behavior/JSON/SARIF formats, MCP tool schemas and response contracts, package layouts, target frameworks, and Roslyn constraints remain unchanged.
Remaining risks
The five Dependabot alerts remain visible on the default branch until merge; their dependency paths are absent on this branch according to
npm auditandnpm ls. The synchronized Sonar issues also remain open until the merge/default-branch analysis updates them. No release has been published, and the Official MCP Registry continues to advertise only the currently published version.