fix: resolve SonarCloud open issues#95
Merged
Merged
Conversation
Reduce SonarCloud findings in Joern semantic analysis and related tests without changing public behavior. How: extracted repeated Joern JSON field literals, rewrote parser loops with a single loop-control exit, grouped BTM persistence inputs, kept Gradle task constructors public with targeted S5993 suppressions because Gradle requires public @Inject task constructors here, and reshaped test assertions to satisfy AssertJ and throwing-lambda rules. Affected components: Joern output parsing, BTM analysis persistence orchestration, Gradle semantic tasks, semantic model tests, Joern adapter tests, manifest tests, and semantic task tests. Bugs fixed: Linux CI timeout stream handling was already merged in PR #94; this commit addresses the remaining SonarCloud OPEN findings from the refreshed main analysis. Features introduced: none. Refactoring/structural changes: limited to Sonar-driven helper extraction and local parameter grouping. Breaking changes: none. Verification executed: Windows targeted affected tests; Windows ./gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --console=plain --stacktrace; Windows ./gradlew.bat validatePlugins --no-daemon --console=plain --stacktrace; WSL ./gradlew clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --console=plain --stacktrace.
|
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.



Summary
java:S5993suppressions because Gradle cannot instantiate these tasks with protected constructors in this projectVerification
./gradlew.bat compileJava compileTestJava --console=plain --stacktrace./gradlew.bat test --tests de.burger.forensics.adapters.filesystem.AnalysisManifestWriterTest --tests de.burger.forensics.adapters.joern.JoernCliSemanticAnalysisAdapterTest --tests de.burger.forensics.adaptersupport.joern.JoernOutputParserTest --tests de.burger.forensics.application.service.AnalyzeSemanticsUseCaseTest --tests de.burger.forensics.domain.model.semantic.SemanticAnalysisModelTest --tests de.burger.forensics.plugin.btmgen.gradle.AnalyzeForensicsSemanticsTaskTest --tests de.burger.forensics.plugin.btmgen.gradle.GenerateBtmTaskTest --tests de.burger.forensics.plugin.btmgen.common.BtmGenerationAdapterValidationTest --console=plain --stacktrace./gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --console=plain --stacktrace./gradlew.bat validatePlugins --no-daemon --console=plain --stacktracewsl.exe bash -lc "cd /mnt/d/Projects/forensics_tracing && ./gradlew clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --console=plain --stacktrace"