Fraunhofer-AISEC / codyze

Codyze is a static analyzer for Java, C, C++ based on code property graphs
https://www.codyze.io
Apache License 2.0
86 stars 18 forks source link

Coko 'Precedes' Evaluator #863

Open CodingDepot opened 4 months ago

CodingDepot commented 4 months ago

This PR adds a Precedes evaluator to Coko that acts as an inverted Follows evaluator. It finds instances of the right hand argument and checks whether it is preceded by the left hand argument.

This is useful when you want to state a condition for a function call to be verified.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 83.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 77.35%. Comparing base (6377273) to head (0debf29).

Files Patch % Lines
.../backends/cpg/coko/evaluators/PrecedesEvaluator.kt 82.97% 4 Missing and 4 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #863 +/- ## ============================================ + Coverage 77.20% 77.35% +0.15% - Complexity 250 259 +9 ============================================ Files 59 60 +1 Lines 1882 1930 +48 Branches 265 272 +7 ============================================ + Hits 1453 1493 +40 - Misses 308 312 +4 - Partials 121 125 +4 ``` | [Flag](https://app.codecov.io/gh/Fraunhofer-AISEC/codyze/pull/863/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/Fraunhofer-AISEC/codyze/pull/863/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC) | `77.35% <83.33%> (+0.15%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.