github / github/codeql-cli-binaries

Should create warning or error for inherited unusable predicates

未關閉
#93 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
CLI
主要語言
沒有語言資料
星號
1k
分支
184
PR 合併指標
30 天內沒有已合併 PR

描述

Currently CodeQL permits writing classes with predicates using database queries, and then subclasses which do not fulfill the requirements for these database types. This renders these inherited predicates unusable and creates pretty cryptic compilation errors when trying to use them. Examples:
- https://github.com/github/codeql/issues/3705
- https://github.com/github/codeql/issues/5320
- https://github.com/github/codeql/issues/7067

It would be good if:
1. The CodeQL compiler would detect such unusuable inherited predicates and cause a compilation error (or at least a warning) for the subclass. This would avoid exposing such subclasses to the user, causing the cryptic compilation errors when they try to use predicates of the subclass.
2. The error message would be clearer, ideally pointing to where the requirement for the database types come from, with predicate call hierarchy if possible. For example for CodeQL Java's `Array.getQualifiedName()` (see https://github.com/github/codeql/issues/7067) it should indicate that `RefType.getPackage()` only supports `@class` and `@interface`.

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the inherited-predicate cases in issues #3705, #5320, and #7067, including CodeQL Java's Array.getQualifiedName() and RefType.getPackage(). Trace how the compiler handles database-type requirements and predicate call hierarchy. Done means unusable inherited predicates are rejected or warned about with a clear diagnostic identifying the originating requirement.

由索引模型根據 Issue 內容生成。

評估

領域
compilers
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
20/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。