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:
Taus
2025-11-26 17:03:03 +00:00
parent c75329d7b7
commit 24a29f46be
34 changed files with 82 additions and 51 deletions

View File

@@ -10,5 +10,6 @@
*/
import python
private import LegacyPointsTo
select sum(Module m | | m.getMetrics().getNumberOfLinesOfCode())
select sum(ModuleMetrics m | | m.getNumberOfLinesOfCode())

View File

@@ -14,10 +14,11 @@
import python
import semmle.python.filters.GeneratedCode
private import LegacyPointsTo
select sum(Module m |
select sum(ModuleMetrics m |
exists(m.getFile().getRelativePath()) and
not m.getFile() instanceof GeneratedFile
|
m.getMetrics().getNumberOfLinesOfCode()
m.getNumberOfLinesOfCode()
)