|
9 | 9 | private import unified |
10 | 10 | private import codeql.unified.internal.AnalysisQuality |
11 | 11 |
|
| 12 | +predicate fileCount(string key, int value) { |
| 13 | + key = "Number of files" and |
| 14 | + value = strictcount(File f) |
| 15 | +} |
| 16 | + |
| 17 | +predicate fileCountByExtension(string key, int value) { |
| 18 | + exists(string extension | |
| 19 | + key = "Number of files with extension " + extension and |
| 20 | + value = strictcount(File f | f.getExtension() = extension) |
| 21 | + ) |
| 22 | +} |
| 23 | + |
| 24 | +predicate numberOfLinesOfCode(string key, int value) { |
| 25 | + key = "Number of lines of code" and |
| 26 | + value = strictsum(File f | any() | f.getNumberOfLinesOfCode()) |
| 27 | +} |
| 28 | + |
| 29 | +predicate numberOfLinesOfCodeByExtension(string key, int value) { |
| 30 | + exists(string extension | |
| 31 | + key = "Number of lines of code with extension " + extension and |
| 32 | + value = strictsum(File f | f.getExtension() = extension | f.getNumberOfLinesOfCode()) |
| 33 | + ) |
| 34 | +} |
| 35 | + |
12 | 36 | from string key, float value |
13 | 37 | where |
14 | 38 | ( |
| 39 | + fileCount(key, value) or |
| 40 | + fileCountByExtension(key, value) or |
| 41 | + numberOfLinesOfCode(key, value) or |
| 42 | + numberOfLinesOfCodeByExtension(key, value) or |
15 | 43 | StaticNameResolutionStatsReport::keyValuePair(key, value) or |
16 | 44 | FilesCoveredByModuleManifestStatsReport::keyValuePair(key, value) |
17 | 45 | ) and |
|
0 commit comments