-
Notifications
You must be signed in to change notification settings - Fork 972
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
Added length check on bugs_by_version
for specific version_number
#2499
Conversation
WalkthroughWalkthroughThe code modification ensures that the Changes
Sequence DiagramsThe changes were too simple and did not modify the control flow significantly, so no sequence diagrams were generated. Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- slither/detectors/attributes/incorrect_solc.py (1 hunks)
Additional comments not posted (2)
slither/detectors/attributes/incorrect_solc.py (2)
74-74
: Ensure correct handling of non-empty bug lists.The change correctly adds a check to ensure the list of bugs for a given
version_number
is non-empty before reporting issues. This should effectively reduce false positives as described in the PR objectives. However, ensure thatbugs_by_version
is always a dictionary and that each key in this dictionary always maps to a list, to avoid any type errors or key errors.
Line range hint
98-100
: Verify interaction between version checking and pragma handling.The
_check_pragma
and_detect
methods rely on the updated_check_version
method. Ensure that the changes in_check_version
do not affect the logic in these methods in unexpected ways, especially considering complex pragma statements and the handling of multiple version constraints.Also applies to: 118-122
Thanks @MukulKolpe! |
Description:
The
incorrect_sol
detector previously checked for known issues using the conditionif version_number in bugs_by_version
. This approach did not account for cases where the list of issues for a given version was empty, leading to false positives.Updated the _check_version method to include a check for non-empty issue lists:
Resolves #2478
Summary by CodeRabbit