github / github/codeql-cli-binaries

analyzing JS code with annotations

オープン
#32 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る
CLI
主要言語
言語のデータがありません
スター
1k
フォーク
184
PR マージ指標
30日以内にマージされた PR はありません

説明

I've been trying to analyze some code from the lumo project. Some of the code contains annotations, see e.g.

https://github.com/anmonteiro/lumo/blob/master/src/js/util.js

which contains code like:

export function expandPath(somePath: string): string {
const tildeExpandedPath = somePath.startsWith('~')
? somePath.replace(/^~/, os.homedir())
: somePath;
return path.resolve(tildeExpandedPath);
}

I have no problem running queries against this project, but when I try to create a test that analyze some code fragments from this project, the extractor fails with a fatal error:

Could not extract a dataset in /Users/franktip/git/ApproximateCallGraphAnalysis/tests/testLumo: Extraction command /Users/franktip/codeql-home/codeql/tools/osx64/java/bin/java failed with status 1
Extraction command /Users/franktip/codeql-home/codeql/tools/osx64/java/bin/java failed with status 1
[1/1] FAILED(EXTRACTION) /Users/franktip/git/ApproximateCallGraphAnalysis/tests/testLumo/reachable.qlref
0 tests passed; 1 tests failed:
FAILED: /Users/franktip/git/ApproximateCallGraphAnalysis/tests/testLumo/reachable.qlref

I have a few questions:
- is there any way to inform the codeql test command that we're analyzing code with annotations?
- can a better error message be produced?
- strangely, the error goes away if I change the file type to ".ts" instead of ".js" (note though that the original project uses the .js extension)

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

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

調査の方向性

Reproduce the failure using tests/testLumo/reachable.qlref and the annotated example in src/js/util.js, then compare the .js and .ts cases described in the report. Trace the extraction command's failure and determine whether annotation support or a more useful diagnostic is required; done means the test no longer fails silently for this input or reports the cause clearly.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
compilers, testing
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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