-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate uncertainty information to Evaluators #886
Conversation
…f missing lazy evaluation
def.signatures.any { sig -> | ||
// We consider a result when both the signature and the flow are not invalid | ||
// However, if at least one of them is OPEN we propagate this information to the caller | ||
val signature = cpgSignature(*sig.parameters.toTypedArray()) |
Check warning
Code scanning / detekt
In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty. Warning
val results = mutableListOf<Result>() | ||
val fqn = [email protected] { sig -> | ||
[email protected]([email protected]) { | ||
val signature = cpgSignature(*sig.parameters.toTypedArray()) |
Check warning
Code scanning / detekt
In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty. Warning
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #886 +/- ##
============================================
+ Coverage 77.20% 77.59% +0.38%
- Complexity 250 256 +6
============================================
Files 59 60 +1
Lines 1882 1959 +77
Branches 265 281 +16
============================================
+ Hits 1453 1520 +67
- Misses 308 315 +7
- Partials 121 124 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/coko/dsl/ResultTest.kt
Fixed
Show fixed
Hide fixed
...-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/coko/dsl/ResultTest.kt
Fixed
Show fixed
Hide fixed
...-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/coko/dsl/ResultTest.kt
Fixed
Show fixed
Hide fixed
This PR will create conflicts with #875 as it refactors the Never and Only Evaluator to be very similar, but does not directly combine them. |
In its current form, Evaluators rely on functions from
ImplementationDsl.Kt
to find relevant code locations.However, these functions only respond with locations without considering false positives that may be detected internally.
With this PR a new return type is used that propagates the knowledge of
OPEN
analysis results as a context to the code locations delivered to the Evaluators.Example:
Consider the
Length
Keyword from #876, The internally used sizeof() evaluator may return-1
when the size can not be determined, but thecpgFlowsTo
function can only returntrue
orfalse
, which then now lead to false positives in either theNever
- orOnly
-Evaluator.With this new return type, the
Only
-Evaluator can check for each location whether the analysis was incomplete and can therefore correctly produce anOPEN
SARIF Result.