mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Don't create stub trap files for anonymous or local classes, or unexpected kinds of top-level declaration
This commit is contained in:
@@ -92,7 +92,7 @@ open class KotlinFileExtractor(
|
||||
|
||||
file.declarations.forEach {
|
||||
extractDeclaration(it, extractPrivateMembers = true, extractFunctionBodies = true)
|
||||
if (it !is IrClass) {
|
||||
if (it is IrProperty || it is IrField || it is IrFunction) {
|
||||
externalClassExtractor.noteElementExtractedFromSource(it, getTrapFileSignature(it))
|
||||
}
|
||||
}
|
||||
@@ -523,7 +523,7 @@ open class KotlinFileExtractor(
|
||||
|
||||
linesOfCode?.linesOfCodeInDeclaration(c, id)
|
||||
|
||||
if (extractFunctionBodies)
|
||||
if (extractFunctionBodies && !c.isAnonymousObject && !c.isLocal)
|
||||
externalClassExtractor.noteElementExtractedFromSource(c)
|
||||
|
||||
return id
|
||||
|
||||
Reference in New Issue
Block a user