Skip to content

Commit fa96793

Browse files
author
Nikita Stroganov
committed
#247 Fix incorrect analysis steps in the sarif report
1 parent 0d7bfde commit fa96793

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

utbot-framework/src/main/kotlin/org/utbot/sarif/SarifReport.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ class SarifReport(
254254
return null
255255

256256
// searching needed method call
257+
val publicMethodCall = "$methodName("
258+
val privateMethodCall = Regex("""$methodName.*\.invoke\(""") // using reflection
257259
val methodCallLineNumber = testsBodyLines
258260
.drop(testMethodStartsAt + 1) // for search after it
259261
.indexOfFirst { line ->
260-
line.contains("$methodName(")
262+
line.contains(publicMethodCall) || line.contains(privateMethodCall)
261263
}
262264
if (methodCallLineNumber == -1)
263265
return null

0 commit comments

Comments
 (0)