github / github/codeql-cli-binaries
analyzing JS code with annotations
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 1k
- Forks
- 184
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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)
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- compilers, testing
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100