github / github/codeql-cli-binaries

analyzing JS code with annotations

Ouverte
#32 11 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
CLI
Langage dominant
Aucune donnée de langage
Étoiles
1k
Forks
184
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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)

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
compilers, testing
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.