Repository navigation
Conversation
| JAVA_ANALYSIS_GENERATED_SUCCESS_FILE_COUNT("java.analysis.generated.success.file_count"), | ||
| JAVA_ANALYSIS_GENERATED_PARSE_ERRORS_FILE_COUNT("java.analysis.generated.parse_errors.file_count"), | ||
| JAVA_ANALYSIS_GENERATED_EXCEPTIONS_FILE_COUNT("java.analysis.generated.exceptions.file_count"), | ||
| JAVA_ANALYSIS_GENERATED_CACHED_FILE_COUNT("java.analysis.generated.cached_file_count"), |
There was a problem hiding this comment.
💡 Quality: generated.cached_file_count key is defined but never emitted
JAVA_ANALYSIS_GENERATED_CACHED_FILE_COUNT is added and wired into JAVA_ANALYSIS_GENERATED, but the only caller of cachedFileCountKey() is JavaAstScanner.scanWithoutParsing. JavaFrontend.scan only calls that on astScanner (main) and astScannerForTests (test). Generated files are added to the cache total and never go through the cache, so java.analysis.generated.cached_file_count is never sent. The doc describes cached_file_count under java.analysis.<scope>. for all three scopes and says it "is emitted when that optimization is attempted". A consumer would reasonably expect the generated key to show up in cache-enabled runs, and it never does. Either remove the generated cached key (pass a null or no-op key), or say in the doc that cached_file_count only covers main and test.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 closed / 1 findings🟡 Medium risk · Adding semantic and classpath telemetry counters changes project-end data collection; aggregation errors could misrepresent Java analysis degradation or configuration. Adds project-end telemetry for Java semantic degradation, including evaluated and affected file counts, resolution diagnostics, cached files, and main/test classpath configuration signals. The change is approved with suggestions. One open minor finding: the 💡 Quality: generated.cached_file_count key is defined but never emitted📄 java-frontend/src/main/java/org/sonar/java/telemetry/TelemetryKey.java:68 📄 java-frontend/src/main/java/org/sonar/java/telemetry/TelemetryKey.java:165 📄 java-frontend/src/main/java/org/sonar/java/JavaFrontend.java:128-142 📄 java-frontend/src/main/java/org/sonar/java/ast/JavaAstScanner.java:89 📄 docs/semantic-model-telemetry.md:23
🤖 Prompt for agentsVerification Rules 2/2 met Repos 4 inspectedFunctional validation No results Rules 2 passed 1 not applicable
Broader impact Repos 4 inspectedCross-repo 4 repositories inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|




SONARJAVA-7229: Java analyses currently expose a type-error total without an affected-file denominator or configuration context. Cache-only analyses can also appear healthy despite having no new semantic observations.
Add counters for evaluated and affected files/modules, resolution diagnostics excluding preview-feature diagnostics, cached files, and file processing outcomes. Record main/test classpath configuration signals for missing properties, no resolved entries, unmatched patterns, and invalid JDK fallback. Aggregate through the existing project telemetry pipeline; retain the existing type-error counter unchanged.
Metric definitions and interpretation are documented in
docs/semantic-model-telemetry.md. These signals identify observed degradation and possible causes; zero observations remain unobserved. The first iteration does not measure every binding, inspect bytecode freshness, or report telemetry from scanner runs that abort before project-end submission. No source paths, type names, or diagnostic messages are transmitted.Validation:
3d1c7cd4e9: Windows unit tests, Plugin QA (including multi-module telemetry), all Linux/Windows ruling jobs, sanity, analysis, and license/security checks. Integration/ruling tests were not run locally.No analyzer rule behavior or configuration requirements change.