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

Filter semgrep results based on initial findings #115

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

drdavella
Copy link
Member

@drdavella drdavella commented Nov 2, 2023

Overview

Only run semgrep on files that have findings from initial run

Description

  • This is an optimization designed to make semgrep faster by limiting the number of files it analyzes
    • This is motivated by the fact that semgrep execution is our long pole in certain environments
  • Only files that have findings from the initial "discovery" run will be considered for further analysis
  • In order to enable this change I made some changes to the structure of processed sarif results

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #115 (552c714) into main (f20e61f) will increase coverage by 0.01%.
The diff coverage is 98.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
+ Coverage   95.95%   95.96%   +0.01%     
==========================================
  Files          62       64       +2     
  Lines        2572     2630      +58     
==========================================
+ Hits         2468     2524      +56     
- Misses        104      106       +2     
Files Coverage Δ
src/codemodder/codemodder.py 97.01% <100.00%> (+0.06%) ⬆️
src/codemodder/codemods/api/__init__.py 95.31% <100.00%> (ø)
src/codemodder/codemods/base_codemod.py 100.00% <100.00%> (ø)
src/codemodder/codemods/base_visitor.py 97.29% <100.00%> (ø)
src/codemodder/executor.py 92.59% <100.00%> (+0.13%) ⬆️
src/codemodder/file_context.py 100.00% <100.00%> (ø)
src/codemodder/result.py 100.00% <100.00%> (ø)
src/codemodder/semgrep.py 94.73% <100.00%> (ø)
src/core_codemods/django_debug_flag_on.py 100.00% <ø> (ø)
.../core_codemods/django_session_cookie_secure_off.py 98.30% <ø> (ø)
... and 4 more

@drdavella drdavella marked this pull request as ready for review November 2, 2023 18:29
@drdavella drdavella force-pushed the filter-semgrep-results branch 2 times, most recently from 2efaf98 to 1d1b195 Compare November 3, 2023 16:29
@drdavella drdavella requested a review from andrecsilva November 3, 2023 16:42
@drdavella
Copy link
Member Author

I want to merge #116 and release a bugfix before merging this one.

@drdavella drdavella force-pushed the filter-semgrep-results branch from 1d1b195 to 552c714 Compare November 6, 2023 14:27
@drdavella drdavella merged commit b22c1ed into main Nov 6, 2023
10 of 11 checks passed
@drdavella drdavella deleted the filter-semgrep-results branch November 6, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants