`filter_paths` filters results only after running detector
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
The problem:
On projects with large amounts of dependencies and especially in foundry projects (if there are lots of tests/scripts), sometimes it takes a lot of time to run the detectors.
Even though the directory/contracts might be specified in `filter_paths`, the slither first runs the detector on these contracts and filters out only afterward.
https://github.com/crytic/slither/blob/977d7bfeabff6ed90faadbe2ee1423bfe04ff5cb/slither/core/slither_core.py#L413C9-L421C1
It seems like we cannot just filter out the contracts from `detector.contracts`, because some detectors might need access to these contracts. However, is it possible to build some kind of dependency graph and filter out the contracts that are not depended on, by the contracts which are not in `filter_paths`?
Or some kind of `do_not_run`/`ignore` parameter, which totally removes the contracts from running detectors?
Contributor guide
Research direction
Start by reading slither/core/slither_core.py around lines 413-421 and tracing how filter_paths is applied relative to detector execution. Compare detector dependency needs with possible contract exclusion behavior; done means unnecessary detector work is skipped without breaking detectors that require filtered contracts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, solidity
- Domain
- devtools, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100