slither icon indicating copy to clipboard operation
slither copied to clipboard

Filter paths before parsing and lowering AST when possible

Open izcoser opened this issue 2 months ago • 2 comments

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

izcoser avatar Apr 11 '24 20:04 izcoser

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

0xalpharush avatar Apr 11 '24 21:04 0xalpharush

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.

izcoser avatar Apr 11 '24 21:04 izcoser