github / github/codeql

Java: Make it more explicit when CodeQL classes and predicates only apply to Kotlin

オープン
#14,556 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

For multiple CodeQL classes (and possibly predicates) for Java / Kotlin it is not obvious that they only apply to Kotlin. This makes it difficult to read the documentation and decide if you have to specially treat a certain CodeQL class, or even what the CodeQL class represents in the first place.

A good (negative) example for this is [`PropertyRefExpr`](https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/Expr.qll/type.Expr$PropertyRefExpr.html). Neither the name nor the documentation give any indication that this is Kotlin-specific. You can only guess this if you have used Kotlin before and the term "property" in combination with "`get`" and "`set`" sound familiar.

Some Kotlin-specific classes seem to be prefixed with `Kotlin` or `Kt` (see [index](https://codeql.github.com/codeql-standard-libraries/java/index.html#K)), but this is not consistent.

I assume this general issue might affect other languages supported by CodeQL as well, such as C / C++ and JavaScript / TypeScript.

Maybe it would be useful if CodeQL QLDoc comments supported some kind of "tag" which would be shown in the documentation whenever the name of the class or predicate is displayed, similar to how the Javadoc displays Preview features (see for example [Java 21 `FormatProcessor`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/FormatProcessor.html)).
Or alternatively it would be good if a certain prefix such as "Kt" would be used consistently.

What do you think?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。