Skip to content

Add code complexity report and quality checks with ratcheting cap#2597

Draft
robgruen wants to merge 11 commits into
mainfrom
dev/robgruen/code_complexity
Draft

Add code complexity report and quality checks with ratcheting cap#2597
robgruen wants to merge 11 commits into
mainfrom
dev/robgruen/code_complexity

Conversation

@robgruen

@robgruen robgruen commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces automated quality gates and reporting for TypeScript code by adding new scripts, dependencies, and CI workflow steps. These changes enforce stricter code quality standards on pull requests, including complexity, lint, circular dependencies, and test debt, while also ensuring generated reports are properly ignored in version control.

CI Workflow Enhancements:

  • Added new PR-only gates in .github/workflows/build-ts.yml to automatically check for increases in code complexity, lint errors, circular dependencies, and test debt compared to the base branch. These steps use new scripts and enforce that quality metrics can only improve or stay the same over time.

New Scripts and Reporting:

  • Added several new npm scripts in ts/package.json for code quality checks and report generation, including code-complexity, code-lint, code-circular, code-debt, and others. These scripts run TypeScript-based tools to generate reports and enforce gates.
  • Added a starter knip.jsonc config file for dead code analysis, supporting the new dead code report script.

Dependency Updates:

  • Introduced new devDependencies for code quality tooling in both ts/package.json and ts/tools/package.json, including eslint, eslint-plugin-sonarjs, jscpd, knip, madge, and typescript-eslint. [1] [2]
  • Updated the list of optional dependencies in ts/package.json, replacing protobufjs with onnxruntime-node.

.gitignore Updates:

  • Updated ts/.gitignore to exclude all generated code quality report outputs from version control, preventing accidental commits of large or sensitive report files.

Comment thread ts/tools/scripts/code/complexityReport.ts Fixed
Comment thread ts/tools/scripts/code/complexityReport.ts Fixed
Comment thread ts/tools/scripts/code/complexityReport.ts Fixed
Comment thread ts/tools/scripts/code/complexityReport.ts Fixed
Comment thread ts/tools/scripts/code/complexityReport.ts Fixed
robgruen and others added 5 commits July 3, 2026 13:56
…ibute sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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