mirror of
https://github.com/github/codeql.git
synced 2026-02-10 12:11:07 +01:00
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
/**
|
|
* @name Extraction metrics file data
|
|
* @description Extraction metrics and related information for profiling the extraction of individual files.
|
|
* @kind table
|
|
* @id js/meta/extraction/file-data
|
|
* @tags meta
|
|
*/
|
|
|
|
import javascript
|
|
import semmle.javascript.meta.ExtractionMetrics::ExtractionMetrics
|
|
|
|
FileWithExtractionMetrics getACacheMember(string cacheFile) { cacheFile = result.getCacheFile() }
|
|
|
|
FileWithExtractionMetrics getACacheHit(FileWithExtractionMetrics f) {
|
|
result = getACacheMember(f.getCacheFile()) and
|
|
result.isFromCache()
|
|
}
|
|
|
|
from FileWithExtractionMetrics fileWithMetrics, boolean fromCache
|
|
where (if fileWithMetrics.isFromCache() then fromCache = true else fromCache = false)
|
|
select fileWithMetrics.getAbsolutePath() as file, fileWithMetrics.getCpuTime() as cpu_nano,
|
|
fileWithMetrics.getNumberOfLines() as lines,
|
|
count(Locatable n | n.getFile() = fileWithMetrics) as locatables,
|
|
count(TypeAnnotation n | n.getFile() = fileWithMetrics) as types,
|
|
fileWithMetrics.getLength() as length, fromCache as from_cache,
|
|
count(getACacheMember(fileWithMetrics.getCacheFile())) as cache_members,
|
|
count(getACacheHit(fileWithMetrics)) as cache_hits, fileWithMetrics.getCacheFile() as cache_file
|