mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Kotlin: Performance tweak
This commit is contained in:
@@ -46,17 +46,24 @@ abstract class GeneratedFile extends File { }
|
||||
*/
|
||||
library class MarkerCommentGeneratedFile extends GeneratedFile {
|
||||
MarkerCommentGeneratedFile() {
|
||||
exists(JavadocElement t | t.getFile() = this |
|
||||
exists(string msg | msg = t.getText() |
|
||||
msg.regexpMatch("(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*") or
|
||||
msg.regexpMatch("(?i).*\\bAny modifications to this file will be lost\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is) (?:mechanically|automatically) generated\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThe following code was (?:auto[ -]?)?generated (?:by|from)\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bAutogenerated by Thrift.*") or
|
||||
msg.regexpMatch("(?i).*\\bGenerated By.*JavaCC.*") or
|
||||
msg.regexpMatch("(?i).*\\bGenerated from .* by ANTLR.*")
|
||||
)
|
||||
any(GeneratedFileMarker t).getFile() = this
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A marker comment that indicates that it is in a generated file.
|
||||
*/
|
||||
private class GeneratedFileMarker extends Top {
|
||||
GeneratedFileMarker() {
|
||||
exists(string msg | msg = this.(JavadocElement).getText() |
|
||||
msg.regexpMatch("(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*") or
|
||||
msg.regexpMatch("(?i).*\\bAny modifications to this file will be lost\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is) (?:mechanically|automatically) generated\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThe following code was (?:auto[ -]?)?generated (?:by|from)\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bAutogenerated by Thrift.*") or
|
||||
msg.regexpMatch("(?i).*\\bGenerated By.*JavaCC.*") or
|
||||
msg.regexpMatch("(?i).*\\bGenerated from .* by ANTLR.*")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user