test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage#310
Merged
askpt merged 1 commit intoMay 16, 2026
Conversation
…er coverage - Add isSupportedLanguage() tests: all 8 supported languages, unsupported languages, and case-sensitivity behaviour - Add getSupportedLanguages() tests: expected language list, minimum count, consistency with isSupportedLanguage() - Add Java analyzer tests: for loop, enhanced-for (for-each), while, do-while, catch clause, ternary expression, nesting penalty, and multi-method analysis - Unit test count grows from 65 to 79 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 71.40% 71.91% +0.51%
==========================================
Files 12 12
Lines 3521 3521
Branches 346 350 +4
==========================================
+ Hits 2514 2532 +18
+ Misses 1005 987 -18
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Node-only unit tests to increase coverage for language-support helpers in MetricsAnalyzerFactory and to exercise additional Java cognitive-complexity constructs/edge cases. This strengthens regression protection for both the language routing layer and the Java analyzer’s construct accounting.
Changes:
- Added unit tests for
MetricsAnalyzerFactory.isSupportedLanguage()across supported, unsupported, and case-variant language IDs. - Added unit tests for
MetricsAnalyzerFactory.getSupportedLanguages()to validate expected IDs and consistency withisSupportedLanguage(). - Expanded Java analyzer unit coverage for loop constructs, catch clauses, ternaries, nesting penalty, and multi-method analysis.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds unit tests for previously untested code paths, growing the unit test count from 65 to 79 tests.
Changes
src/unit/unit.test.tsisSupportedLanguage()tests (3 new): covers all 8 supported language IDs, unsupported/unknown languages, and case-sensitivitygetSupportedLanguages()tests (3 new): verifies all expected languages are present, minimum count, and consistency withisSupportedLanguage()forloop, enhanced-for (for-each),while,do-while,catchclause, ternary expression, nesting penalty, and multi-method analysisWhy
isSupportedLanguage()was added in #305 but had no dedicated unit tests. The Java analyzer (added in #296) had only 2 test cases; the new tests cover all remaining control-flow constructs.Test Status
VS Code integration tests require a display server and are infrastructure-dependent — unrelated to these changes.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comSee Network Configuration for more information.