Add ClassifyFiles.ql

This commit is contained in:
Arthur Baars
2021-09-14 16:30:34 +02:00
parent c2ec6407f5
commit e03fe0fcd4
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
/**
* @name Classify files
* @description This query produces a list of all files in a database
* that are classified as generated code or test code.
*
* Used by LGTM.
* @kind file-classifier
* @id rb/file-classifier
*/
import ruby
import codeql.ruby.filters.GeneratedCode
predicate classify(File f, string category) {
f instanceof GeneratedCodeFile and category = "generated"
}
from File f, string category
where classify(f, category)
select f, category