mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: CG trace: Metrics, number of recorded calls not ignored
turned out to be useful after all :P
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
import RecordedCalls
|
||||
|
||||
// colum i is just used for sorting
|
||||
from string text, float number, float ratio, int i
|
||||
where
|
||||
exists(int all_rcs | all_rcs = count(XMLRecordedCall rc) and ratio = number / all_rcs |
|
||||
text = "XMLRecordedCall" and number = all_rcs and i = 0
|
||||
or
|
||||
text = "IgnoredRecordedCall" and number = count(IgnoredRecordedCall rc) and i = 1
|
||||
or
|
||||
text = "not IgnoredRecordedCall" and number = all_rcs - count(IgnoredRecordedCall rc) and i = 2
|
||||
)
|
||||
or
|
||||
text = "----------" and
|
||||
number = 0 and
|
||||
ratio = 0 and
|
||||
i = 2
|
||||
i = 10
|
||||
or
|
||||
exists(int all_not_ignored_rcs |
|
||||
all_not_ignored_rcs = count(XMLRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
|
||||
@@ -19,17 +22,17 @@ where
|
||||
|
|
||||
text = "IdentifiedRecordedCall" and
|
||||
number = count(IdentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
|
||||
i = 3
|
||||
i = 11
|
||||
or
|
||||
text = "UnidentifiedRecordedCall" and
|
||||
number = count(UnidentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
|
||||
i = 4
|
||||
i = 12
|
||||
)
|
||||
or
|
||||
text = "----------" and
|
||||
number = 0 and
|
||||
ratio = 0 and
|
||||
i = 5
|
||||
i = 20
|
||||
or
|
||||
exists(int all_identified_rcs |
|
||||
all_identified_rcs = count(IdentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
|
||||
@@ -40,7 +43,7 @@ where
|
||||
count(PointsToBasedCallGraph::ResolvableRecordedCall rc |
|
||||
not rc instanceof IgnoredRecordedCall
|
||||
) and
|
||||
i = 6
|
||||
i = 21
|
||||
or
|
||||
text = "points-to not ResolvableRecordedCall" and
|
||||
number =
|
||||
@@ -48,6 +51,6 @@ where
|
||||
count(PointsToBasedCallGraph::ResolvableRecordedCall rc |
|
||||
not rc instanceof IgnoredRecordedCall
|
||||
) and
|
||||
i = 7
|
||||
i = 22
|
||||
)
|
||||
select i, text, number, ratio * 100 + "%" as percent order by i
|
||||
|
||||
Reference in New Issue
Block a user