mirror of
https://github.com/github/codeql.git
synced 2026-04-20 06:24:03 +02:00
Merge pull request #19932 from joefarebrother/python-qual-init-del-calls
Python: Modernize 4 queries for missing/multiple calls to init/del methods
This commit is contained in:
@@ -856,9 +856,14 @@ Class getNextClassInMroKnownStartingClass(Class cls, Class startingClass) {
|
||||
)
|
||||
}
|
||||
|
||||
private Function findFunctionAccordingToMroKnownStartingClass(
|
||||
Class cls, Class startingClass, string name
|
||||
) {
|
||||
/**
|
||||
* Gets a potential definition of the function `name` of the class `cls` according to our approximation of
|
||||
* MRO for the class `startingCls` (see `getNextClassInMroKnownStartingClass` for more information).
|
||||
*
|
||||
* Note: this is almost the same as `findFunctionAccordingToMro`, except we know the
|
||||
* `startingClass`, which can give slightly more precise results.
|
||||
*/
|
||||
Function findFunctionAccordingToMroKnownStartingClass(Class cls, Class startingClass, string name) {
|
||||
result = cls.getAMethod() and
|
||||
result.getName() = name and
|
||||
cls = getADirectSuperclass*(startingClass)
|
||||
@@ -871,7 +876,7 @@ private Function findFunctionAccordingToMroKnownStartingClass(
|
||||
|
||||
/**
|
||||
* Gets a potential definition of the function `name` according to our approximation of
|
||||
* MRO for the class `cls` (see `getNextClassInMroKnownStartingClass` for more information).
|
||||
* MRO for the class `startingCls` (see `getNextClassInMroKnownStartingClass` for more information).
|
||||
*
|
||||
* Note: this is almost the same as `findFunctionAccordingToMro`, except we know the
|
||||
* `startingClass`, which can give slightly more precise results.
|
||||
|
||||
Reference in New Issue
Block a user