Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Graph viewer: edges ordered by wrong attribute

Aperta
#1,332 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia riproducendo la query del grafo nell'issue e individua il codice del visualizzatore del grafo che applica semmle.order ai nodi e agli archi. Verifica che i nodi radice rimangano ordinati in modo decrescente, mentre ogni insieme di nodi figli segua l'ordine crescente del predicato degli archi, quindi aggiungi o aggiorna un test di regressione se il progetto dispone di una copertura per l'ordinamento dei grafi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug VSCode

The graph viewer displays child nodes in the order specified by the semmle.order attribute on the nodes predicate, when it should display them in the order specified by the semmle.order attribute on the edges predicate.

This can be demonstrated with the following graph query:

/**
 * @kind graph
 * @id foo
 */
query predicate nodes(string node, string attr, string val) {
  exists(int i | i = [0 .. 5] and node = i.toString() |
    attr = "semmle.label" and val = node
    or
    attr = "semmle.order" and val = (-i).toString()
  )
}

query predicate edges(string a, string b, string attr, string val) {
  (
    a = "0" and b = ["1", "2"]
    or
    a = "3" and b = ["4", "5"]
  ) and
  (
    attr = "semmle.label" and val = ""
    or
    attr = "semmle.order" and val = b.toString()
  )
}

The nodes predicate specifies that nodes should be ordered in descending order (-i), while the edges predicate specifies that edges should be ordered in ascending order.

In the following screenshot you can see that, while the two subgraphs appear to be ordered correctly, i.e. in descending order of the root node's value (3, then 0), the child nodes also appear left-to-right in descending order (5, 4; 2, 1), which suggests to me that they are also being ordered according to the attribute in the nodes predicate. I would expect them to appear in ascending order.

image
Version

VS Code: 1.66.2
CodeQL extension: 1.6.5

Lingua principale
TypeScript
Stelle
539
Fork
240
Merge medio
2g 6h
PR unite (30g)
29

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/vscode-codeql

Tutte le issue di github/vscode-codeql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.