mirror of
https://github.com/github/codeql.git
synced 2026-04-14 19:44:03 +02:00
Python: Add ternary overridesMethod
This one also allows easy access to the method being overridden and the class on which it resides. This let's us simplify DocStrings.ql accordingly.
This commit is contained in:
@@ -30,9 +30,7 @@ predicate needs_docstring(Scope s) {
|
||||
|
||||
predicate function_needs_docstring(FunctionMetrics f) {
|
||||
not exists(Function base |
|
||||
DuckTyping::overridesMethod(f) and
|
||||
base.getScope() = getADirectSuperclass+(f.getScope()) and
|
||||
base.getName() = f.getName() and
|
||||
DuckTyping::overridesMethod(f, _, base) and
|
||||
not function_needs_docstring(base)
|
||||
) and
|
||||
f.getName() != "lambda" and
|
||||
|
||||
Reference in New Issue
Block a user