github / github/codeql

Java: Javadoc.getCommentedElement() returns bogus MetricElement & Annotatable

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

説明

Relates to #3698

For some projects the predicate `Javadoc.getCommentedElement()` returns some bogus element whose only QL classes are MetricElement and Annotatable, and which has no `toString()`:
```ql
import java

from Javadoc javadoc, Top commentedElement, boolean hasToString, boolean hasLocation
where
commentedElement = javadoc.getCommentedElement()
and forall(string qlClass | qlClass = commentedElement.getAQlClass() |
qlClass = ["MetricElement", "Annotatable"]
)
and if exists(commentedElement.toString()) then hasToString = true else hasToString = false
and if exists(commentedElement.getLocation()) then hasLocation = true else hasLocation = false
select javadoc, commentedElement.getAPrimaryQlClass(), hasToString, hasLocation
```
[Query console link](https://lgtm.com/query/7390634026556959969/)

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

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

評価

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

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

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