Skip to content

test(coverage): boost SonarCloud to 80%+ — grammar exclusion fix + 1500 new tests#35

Merged
aksOps merged 2 commits into
mainfrom
coverage/boost-80pct-r2
Apr 4, 2026
Merged

test(coverage): boost SonarCloud to 80%+ — grammar exclusion fix + 1500 new tests#35
aksOps merged 2 commits into
mainfrom
coverage/boost-80pct-r2

Conversation

@aksOps

@aksOps aksOps commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix grammar exclusion: workflow now explicitly passes -Dsonar.exclusions and -Dsonar.coverage.exclusions for **/grammar/**. The 646 uncovered grammar base class lines (CPP14ParserBase, CSharpLexerBase, etc.) were counting against coverage despite sonar-project.properties having the exclusion — local line coverage jumps from 79.9% → 82.7% from this fix alone
  • 1500+ new tests (3219 total, up from ~1700) targeting the exact files SonarCloud showed as low-coverage
  • Local JaCoCo: 90.6% line coverage (up from 87%), 72.7% branch coverage

Files targeted by tests (SonarCloud data)

File Before Uncovered lines
GraphStore.java 51.8% 289
PythonStructuresDetector.java 56.3% 152
ClassHierarchyDetector.java 51.4% 139
DjangoModelDetector.java 57.2% 113
SpringRestDetector.java 58.3% 108
FastAPIAuthDetector.java 53.4% 90
JpaEntityDetector.java 61.6% 83
DjangoAuthDetector.java 55.4% 82
SpringSecurityDetector.java 59.7% 73
Various 0% classes 0% 60+

Test plan

  • All 3219 tests pass locally
  • mvn test clean — zero failures, zero errors
  • Grammar exclusion fix verified in workflow YAML
  • SonarCloud will re-analyze on PR merge to main

🤖 Generated with Claude Code

aksOps and others added 2 commits April 4, 2026 09:40
…etectors

Adds 3-4 tests per detector covering the detectWithRegex() paths that were
previously unreachable (Python: content > 500KB triggers ANTLR bypass;
Java: NUL-byte content triggers JavaParser bypass → regex fallback).

Detectors covered:
- Python (10): PythonStructures, DjangoModel, DjangoAuth, FastAPIAuth,
  CeleryTask, DjangoView, FlaskRoute, FastAPIRoute, PydanticModel, SQLAlchemy
- Java (4): SpringRest, SpringSecurity, JpaEntity (added to existing
  ClassHierarchyDetectorBranches section in JavaDetectorsBranchCoverageTest)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…al line coverage

- Fix workflow sonar.exclusions to explicitly exclude grammar/** from analysis
  and coverage calculations (was being counted despite sonar-project.properties)
- Add GraphStoreTopologyAndStatsTest: 33 tests for getTopology(), countEdges(),
  findEdgesPaginated(), getFilePathsWithCounts(), findNodesWithoutIncomingSemantic(),
  findEndpointNeighborsBatch(), searchLexical(), and more (289 uncovered lines)
- Add extended tests for Python detectors: PythonStructures, DjangoModel,
  DjangoAuth, FastAPIAuth, FastAPIRoute, FlaskRoute, Pydantic, SQLAlchemy,
  CeleryTask (500+ uncovered lines)
- Add extended tests for Java detectors: SpringRest, SpringSecurity,
  ClassHierarchy, JpaEntity, PublicApi (456 uncovered lines)
- Add tests for CLI commands: BundleCommand, FlowCommand, TopologyCommand
- Add tests for 0%-coverage classes: CacheFlowDataSource, KindConverterTest,
  LexicalQueryService, SpaController, ArtifactMetadata
- Add ExpressRouteDetectorExtendedTest, FlowEngineExtendedTest,
  TopologyControllerExtendedTest, EvidencePackAssemblerExtendedTest
- Fix ModelCoverageTest: write(null) throws IAE in Neo4j driver (not null value)
- All 3219 tests pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

@aksOps aksOps merged commit daafc78 into main Apr 4, 2026
10 checks passed
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