-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Python: Modernize 4 queries for missing/multiple calls to init/del methods #19932
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
base: main
Are you sure you want to change the base?
Python: Modernize 4 queries for missing/multiple calls to init/del methods #19932
Conversation
QHelp previews: python/ql/src/Classes/CallsToInitDel/MissingCallToDel.qhelpMissing call to superclass
|
… change alerts to alert on the class and provide clearer information, using optional location links.
…ke much sense (__init__ is still called anyway)
call.calls(callTarget, name) and | ||
self.getParameter() = meth.getArg(0) and | ||
self.(DataFlow::LocalSourceNode).flowsTo(call.getArg(0)) and | ||
not exists(Class target | callTarget = classTracker(target)) |
Check warning
Code scanning / CodeQL
Omittable 'exists' variable Warning
in this argument
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.
I believe this is a little more readable, conveying the intent that we're looking for cases where no class can be tracked here.
Modernizes py/missing-call-to-init, py/missing-call-to-del, py/multiple-calls-to-init,, and py/multiplecalls-to-del.
Uses DataFlowDispatch methods rather than. pointsTo.