mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #10759 from igfoo/igfoo/numlines2
kotlin: Populate numlines
This commit is contained in:
@@ -4,13 +4,13 @@ open class TestKt {
|
||||
|
||||
}
|
||||
|
||||
interface ParentIf {
|
||||
interface ParentIfK {
|
||||
|
||||
fun inheritedInterfaceMethodK()
|
||||
|
||||
}
|
||||
|
||||
interface ChildIf : ParentIf {
|
||||
interface ChildIfK : ParentIfK {
|
||||
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class ChildKt : TestKt() {
|
||||
c.equals(c)
|
||||
c.hashCode()
|
||||
c.inheritMe()
|
||||
val c2: ParentIf? = null
|
||||
val c2: ParentIfK? = null
|
||||
c2?.inheritedInterfaceMethodK()
|
||||
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
| Test.kt:24:7:24:15 | equals(...) | equals | Object |
|
||||
| Test.kt:25:7:25:16 | hashCode(...) | hashCode | Object |
|
||||
| Test.kt:26:7:26:17 | inheritMe(...) | inheritMe | TestKt |
|
||||
| Test.kt:28:9:28:35 | inheritedInterfaceMethodK(...) | inheritedInterfaceMethodK | ParentIf |
|
||||
| Test.kt:28:9:28:35 | inheritedInterfaceMethodK(...) | inheritedInterfaceMethodK | ParentIfK |
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
| test.kt:2:1:4:1 | foo | 3 | 3 | 0 |
|
||||
| test.kt:8:1:8:9 | getX | 1 | 1 | 0 |
|
||||
| test.kt:18:1:18:17 | getY | 5 | 1 | 4 |
|
||||
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |
|
||||
| test.kt:21:5:24:5 | bar | 4 | 3 | 1 |
|
||||
| test.kt:25:5:25:21 | getSomeField | 1 | 1 | 0 |
|
||||
4
java/ql/test/kotlin/library-tests/numlines/callable.ql
Normal file
4
java/ql/test/kotlin/library-tests/numlines/callable.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from Callable c
|
||||
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()
|
||||
@@ -0,0 +1 @@
|
||||
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |
|
||||
4
java/ql/test/kotlin/library-tests/numlines/classes.ql
Normal file
4
java/ql/test/kotlin/library-tests/numlines/classes.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from Class c
|
||||
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()
|
||||
@@ -0,0 +1 @@
|
||||
| test.kt:0:0:0:0 | test | 28 | 11 | 9 |
|
||||
4
java/ql/test/kotlin/library-tests/numlines/files.ql
Normal file
4
java/ql/test/kotlin/library-tests/numlines/files.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from File f
|
||||
select f, f.getTotalNumberOfLines(), f.getNumberOfLinesOfCode(), f.getNumberOfCommentLines()
|
||||
27
java/ql/test/kotlin/library-tests/numlines/test.kt
Normal file
27
java/ql/test/kotlin/library-tests/numlines/test.kt
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
fun foo ( x : Int ) {
|
||||
val y = ( x + 1 )
|
||||
}
|
||||
|
||||
// test
|
||||
|
||||
val x = 4
|
||||
|
||||
/*
|
||||
test
|
||||
*/
|
||||
|
||||
/**
|
||||
test
|
||||
*/
|
||||
|
||||
val y = 5 // test
|
||||
|
||||
class Foo {
|
||||
fun bar() {
|
||||
// comment
|
||||
return
|
||||
}
|
||||
val someField = 3
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user