slither
slither copied to clipboard
Filter paths before parsing and lowering AST when possible
Describe the issue:
When we filter out a file through --filter-paths, Slither still wastes time analyzing that file, and only skips returning the results for it. Is this not a bug?
Code example to reproduce the issue:
Not needed.
Version:
0.10.2
Relevant log output:
No response
We don't currently filter out beforehand because a file that is filtered out may be referenced by other files e.g. library/parent contract in inheritance that must also be analyzed. In terms of performance, I would expect a higher priority is reducing the time we spend in solc (https://github.com/foundry-rs/foundry/issues/7212). We do need to revisit Slither's performance though and I'm sure there's a way to more intelligently filter to eliminate this overhead.
related issue https://github.com/crytic/slither/issues/2026
Targeting a specific contract like src/ContractX.sol will skip analyzing others, so one would expect --filter-paths to behave similarly. Thank you for clarifying.