Skip to content
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

Combine Only and Never Evaluator #875

Merged
merged 7 commits into from
Sep 17, 2024
Merged

Combine Only and Never Evaluator #875

merged 7 commits into from
Sep 17, 2024

Conversation

CodingDepot
Copy link
Collaborator

The Only- and Never-Evaluators have a lot of overlap in their logic, which makes sense regarding their very similar purpose.
However, this also causes them to use duplicated code to achieve the same result.

Furthermore, over time slight differences in the implementations emerged which makes it increasingly annoying to implement changes for both Evaluators.
For example, the Only-Evalutor created a pass-Finding for each valid call while the Never-Evaluator did not.
Combining both evaluators makes it more easy to keep the functionality synchronized while still allowing for smaller differences depending on the chosen functionality.

This PR also includes an example for a new functionality for both Evaluators. Each finding generated by a Never- or Only- Evaluator will now include usages of the code as relatedLocations.

@CodingDepot CodingDepot added enhancement New feature or request maintenance labels Jun 17, 2024
@CodingDepot CodingDepot self-assigned this Jun 17, 2024
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.46%. Comparing base (d0c45be) to head (f137a7a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../codyze/backends/cpg/coko/dsl/ImplementationDsl.kt 83.33% 0 Missing and 2 partials ⚠️
...backends/cpg/coko/evaluators/OnlyNeverEvaluator.kt 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #875      +/-   ##
============================================
- Coverage     77.58%   77.46%   -0.12%     
+ Complexity      273      263      -10     
============================================
  Files            61       60       -1     
  Lines          1972     1966       -6     
  Branches        280      282       +2     
============================================
- Hits           1530     1523       -7     
  Misses          313      313              
- Partials        129      130       +1     
Flag Coverage Δ
unittests 77.46% <89.65%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fwendland fwendland merged commit 5587864 into main Sep 17, 2024
6 checks passed
@fwendland fwendland deleted the rh/onlynever branch September 17, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants