mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
Kotlin: Add a numlines test
This commit is contained in:
@@ -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