github / github/codeql-cli-binaries

analyzing JS code with annotations

Aberta
#32 11 comentários 0 reações 0 responsáveis Ver no GitHub
CLI
Linguagem predominante
Sem dados de linguagem
Estrelas
1k
Forks
184
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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)

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript
Domínio
compilers, testing
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.