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 paths before parsing and lowering AST when possible #2421

Open
izcoser opened this issue Apr 11, 2024 · 2 comments
Open

Filter paths before parsing and lowering AST when possible #2421

izcoser opened this issue Apr 11, 2024 · 2 comments
Labels
enhancement New feature or request High Priority

Comments

@izcoser
Copy link

izcoser commented Apr 11, 2024

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 izcoser added the bug-candidate Bugs reports that are not yet confirmed label Apr 11, 2024
@0xalpharush
Copy link
Member

0xalpharush commented Apr 11, 2024

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 (foundry-rs/foundry#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 #2026

@izcoser
Copy link
Author

izcoser commented Apr 11, 2024

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.

@0xalpharush 0xalpharush added enhancement New feature or request High Priority and removed bug-candidate Bugs reports that are not yet confirmed labels Apr 11, 2024
@0xalpharush 0xalpharush changed the title [Bug-Candidate]: Filtered out files are still analyzed Filter paths before parsing and lowering AST when possible Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High Priority
Projects
None yet
Development

No branches or pull requests

2 participants