mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Python: Fix all metrics-related compilation failures
In hindsight, having a `.getMetrics()` method that just returns `this` is somewhat weird. It's possible that it predates the existence of the inline cast, however.
This commit is contained in:
@@ -28,12 +28,12 @@ predicate needs_docstring(Scope s) {
|
||||
)
|
||||
}
|
||||
|
||||
predicate function_needs_docstring(Function f) {
|
||||
predicate function_needs_docstring(FunctionMetrics f) {
|
||||
not exists(FunctionValue fo, FunctionValue base | fo.overrides(base) and fo.getScope() = f |
|
||||
not function_needs_docstring(base.getScope())
|
||||
) and
|
||||
f.getName() != "lambda" and
|
||||
(f.getMetrics().getNumberOfLinesOfCode() - count(f.getADecorator())) > 2 and
|
||||
(f.getNumberOfLinesOfCode() - count(f.getADecorator())) > 2 and
|
||||
not exists(PythonPropertyObject p |
|
||||
p.getGetter().getFunction() = f or
|
||||
p.getSetter().getFunction() = f
|
||||
|
||||
Reference in New Issue
Block a user