We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aea4910 + 52b2290 commit c7a6b1eCopy full SHA for c7a6b1e
java/ql/consistency-queries/visibility.ql
@@ -0,0 +1,22 @@
1
+import java
2
+
3
+string visibility(Method m) {
4
+ result = "public" and m.isPublic()
5
+ or
6
+ result = "protected" and m.isProtected()
7
8
+ result = "private" and m.isPrivate()
9
10
+ result = "internal" and m.isInternal()
11
+}
12
13
+// TODO: This ought to check more than just methods
14
+from Method m
15
+where
16
+ // TODO: This ought to work for everything, but for now we
17
+ // restrict to things in Kotlin source files
18
+ m.getFile().isKotlinSourceFile() and
19
+ // TODO: This ought to have visibility information
20
+ not m.getName() = "<clinit>" and
21
+ count(visibility(m)) != 1
22
+select m, concat(visibility(m), ", ")
0 commit comments