GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — codeql/java/ql/src/Telemetry/ExtractorInformation.ql at main · github/codeql Expand file tree/ Copy pathExtractorInformation.qlMore file actions 107 lines (95 loc) · 3.62 KB / Copy pathExtractorInformation.qlFile metadata and controls107 lines (95 loc) · 3.62 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 /** * @name Java extraction information * @description Information about the extraction for a Java database * @kind metric * @tags summary telemetry * @id java/telemetry/extraction-information */ import java import semmle.code.java.Diagnostics import DatabaseQuality predicate compilationInfo(string key, int value) { exists(Compilation c, string infoKey | key = infoKey + ": " + c.getInfo(infoKey) and value = 1 ) } predicate fileCount(string key, int value) { key = "Number of files" and value = strictcount(File f) } predicate fileCountByExtension(string key, int value) { exists(string extension | key = "Number of files with extension " + extension and value = strictcount(File f | f.getExtension() = extension) ) } predicate totalNumberOfLines(string key, int value) { key = "Total number of lines" and value = strictsum(File f | any() | f.getTotalNumberOfLines()) } predicate numberOfLinesOfCode(string key, int value) { key = "Number of lines of code" and value = strictsum(File f | any() | f.getNumberOfLinesOfCode()) } predicate totalNumberOfLinesByExtension(string key, int value) { exists(string extension | key = "Total number of lines with extension " + extension and value = strictsum(File f | f.getExtension() = extension | f.getTotalNumberOfLines()) ) } predicate numberOfLinesOfCodeByExtension(string key, int value) { exists(string extension | key = "Number of lines of code with extension " + extension and value = strictsum(File f | f.getExtension() = extension | f.getNumberOfLinesOfCode()) ) } predicate extractorDiagnostics(string key, int value) { exists(string extractor, int severity | key = "Number of diagnostics from " + extractor + " with severity " + severity.toString() and value = strictcount(Diagnostic d | d.getGeneratedBy() = extractor and d.getSeverity() = severity) ) } /* * Just counting the diagnostics doesn't give the full picture, as * CODEQL_EXTRACTOR_KOTLIN_DIAGNOSTIC_LIMIT means that some diagnostics * will be suppressed. In that case, we need to look for the * suppression message, uncount those that did get emitted, uncount the * suppression message itself, and then add on the full count. */ predicate extractorTotalDiagnostics(string key, int value) { exists(string extractor, string limitRegex | limitRegex = "Total of ([0-9]+) diagnostics \\(reached limit of ([0-9]+)\\).*" and key = "Total number of diagnostics from " + extractor and value = strictcount(Diagnostic d | d.getGeneratedBy() = extractor) + sum(Diagnostic d | d.getGeneratedBy() = extractor | d.getMessage().regexpCapture(limitRegex, 1).toInt() - d.getMessage().regexpCapture(limitRegex, 2).toInt() - 1 ) ) } from string key, int value where not exists(string pattern | extractorInformationSkipKey(pattern) and key.matches(pattern)) and ( compilationInfo(key, value) or fileCount(key, value) or fileCountByExtension(key, value) or totalNumberOfLines(key, value) or numberOfLinesOfCode(key, value) or totalNumberOfLinesByExtension(key, value) or numberOfLinesOfCodeByExtension(key, value) or extractorDiagnostics(key, value) or extractorTotalDiagnostics(key, value) or CallTargetStatsReport::numberOfOk(key, value) or CallTargetStatsReport::numberOfNotOk(key, value) or CallTargetStatsReport::percentageOfOk(key, any(float x | value = x.floor())) or ExprTypeStatsReport::numberOfOk(key, value) or ExprTypeStatsReport::numberOfNotOk(key, value) or ExprTypeStatsReport::percentageOfOk(key, any(float x | value = x.floor())) ) select key, value |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |