You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 This pull request was created by Repo Assist, an automated AI assistant.
Summary
Adds cognitive complexity analysis for C++ source files, bringing the extension's language coverage to 10 languages (C#, Go, Java, JS, TS, Python, Rust, TSX, JSX, and now C++).
CppMetricsAnalyzer uses tree-sitter-cpp@0.23.4 to parse C++ and calculates cognitive complexity for all function_definition nodes (free functions, class methods, constructors, destructors, and operator overloads).
Supported complexity constructs:
Construct
Increment
if, while, for, for-range, do-while, switch
+1 + nesting
try block
+1 + nesting
catch clause
+1 + nesting
&& / || (per distinct chain)
+1 flat
Ternary ?:
+1 flat
Lambda expression (when nested)
+1 + nesting
break / continue (inside nesting)
+1 flat
goto
+1 flat
Qualified naming: methods and operators inside classes are reported as ClassName::methodName or ClassName::operator==
Out-of-line definitions (Foo::bar() defined outside the class) use the fully-qualified name from the declarator
Lambdas are collected as separate analysis entries; a top-level lambda (not inside any nesting construct) does not add to the enclosing function's score
src/metricsAnalyzer/metricsAnalyzerFactory.ts
Registers cpp as a supported language ID.
package.json
Adds tree-sitter-cpp@0.23.4 as a runtime dependency (compatible with the existing tree-sitter@0.21.1 peer constraint)
Adds onLanguage:cpp activation event
Adds cpp and c++ to keywords
samples/Test.cpp
Sample C++ file with annotated complexity scores for manual extension testing.
Dependency note
tree-sitter-cpp@0.23.4 declares peerDependencies: { "tree-sitter": "^0.21.1" } which matches the current pinned tree-sitter@0.21.1, so no version bump is required.
Test Status
npm run compile ✅ (0 errors)
npm run lint ✅ (0 warnings)
npm run test:unit ✅ 225 passing (was 201), 0 failing
Coverage (analyzer/factory code, VS Code-API files excluded):
All coverage thresholds met (no threshold violations)
This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.
Protected files
package.json
The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.
Create the pull request manually
# Download the patch from the workflow run
gh run download 30913641687 -n agent -D /tmp/agent-30913641687
# Create a new branch
git checkout -b repo-assist/feat-cpp-support-20260804-ac6a6b61a5392712 main
# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-30913641687/aw-repo-assist-feat-cpp-support-20260804.patch
# Push the branch and create the pull request
git push origin repo-assist/feat-cpp-support-20260804-ac6a6b61a5392712
gh pr create --title '[repo-assist] feat: add C++ cognitive complexity analyzer' --base main --head repo-assist/feat-cpp-support-20260804-ac6a6b61a5392712 --repo askpt/code-metrics
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.com
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
🤖 This pull request was created by Repo Assist, an automated AI assistant.
Summary
Adds cognitive complexity analysis for C++ source files, bringing the extension's language coverage to 10 languages (C#, Go, Java, JS, TS, Python, Rust, TSX, JSX, and now C++).
What's New
src/metricsAnalyzer/languages/cppAnalyzer.ts(new)CppMetricsAnalyzerusestree-sitter-cpp@0.23.4to parse C++ and calculates cognitive complexity for allfunction_definitionnodes (free functions, class methods, constructors, destructors, and operator overloads).Supported complexity constructs:
if,while,for,for-range,do-while,switchtryblockcatchclause&&/||(per distinct chain)?:break/continue(inside nesting)gotoClassName::methodNameorClassName::operator==Foo::bar()defined outside the class) use the fully-qualified name from the declaratorsrc/metricsAnalyzer/metricsAnalyzerFactory.tsRegisters
cppas a supported language ID.package.jsontree-sitter-cpp@0.23.4as a runtime dependency (compatible with the existingtree-sitter@0.21.1peer constraint)onLanguage:cppactivation eventcppandc++to keywordssamples/Test.cppSample C++ file with annotated complexity scores for manual extension testing.
Dependency note
tree-sitter-cpp@0.23.4declarespeerDependencies: { "tree-sitter": "^0.21.1" }which matches the current pinnedtree-sitter@0.21.1, so no version bump is required.Test Status
Coverage (analyzer/factory code, VS Code-API files excluded):
cppAnalyzer.ts: 94.87% stmts, 87.5% branches, 100% functionsWarning
Protected Files — Push Permission Denied
This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.
Protected files
package.jsonThe push was rejected because GitHub Actions does not have
workflowspermission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.Create the pull request manually
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comSee Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run