github / github/codeql

Get full string for exported JavaScript results

Offen
#18,723 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

Consider the query below, which attempts to get the callee and the associated parameters. The returned string for the parameters is often truncated (sanitized) when the length is longer than 20 characters [as seen in the source code](https://github.com/github/codeql/blob/7361ad977a5dd5252d21f5fd23de47d75b763651/javascript/extractor/src/com/semmle/js/extractor/TextualExtractor.java#L121). For instance, if the expected full string is `bd0be325-86d9-4f16-95fa-b677f7455177`, it returns something like `bd0be ... 5177`, which is not helpful for my project.

While there's a good reason for this behavior, I would really like to be able to export the full string for a follow-up analysis.

```
import javascript

from CallExpr call, Expr parameters
where
parameters = call.getArgument(_)

select call.getCallee(), parameters.toString()
```

I have seen a similar issue ([results abbreviation #9890](https://github.com/github/codeql/issues/9890)), but the suggestions do not address my problem.

I would really appreciate any support I can get here. Thank you.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with javascript/extractor/src/com/semmle/js/extractor/TextualExtractor.java at the linked line, then reproduce the query using parameters.toString() to observe the current truncation. Trace how exported result strings are sanitized and identify the relevant coverage for full-string output. Done means the query can export the complete parameter value without the current abbreviation, with behavior verified by an appropriate test or reproduction.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.