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
Query and tests for sum without domain #12292
Conversation
|
This looks great! I guess uses of |
Yes, that's true. You could also think about |
You could check whether the type of the inner expression to determine whether it's counting integers. |
I did think about this, but didn't do this initially as I wasn't sure how often people people counted integers, and whether it's legitimate. So I coded this up and it turns out that we do this a lot in CodeQL for many different reasons. e.g. count(body.indexOf("(")) != count(body.indexOf(")"))
strictcount(e.getValue().toInt()) = 1
result = count(this.getFormat().indexOf("%"))
count(node.getStackSizeAfter()) != 1
actualArity = count(row.indexOf(";")) + 1I couldn't see any additional true positives. For that reason, let's not try to cover |
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.
![]()
This produces 14 results on this repo, and they are mostly good results.