Graph viewer: edges ordered by wrong attribute
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by reproducing the graph query in the issue and locate the graph viewer code that applies semmle.order to nodes and edges. Confirm that root nodes remain ordered descending while each set of child nodes follows the edges predicate's ascending order, then add or update a regression test if the project has coverage for graph ordering.
Written by the indexing model from the issue text.
Description
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.
Version
VS Code: 1.66.2
CodeQL extension: 1.6.5
- Dominant language
- TypeScript
- Stars
- 539
- Forks
- 240
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 29
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/vscode-codeql
-
bug VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#4471 · 1 comment ·
-
bug enhancement VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#592 · 2 comments ·
-
enhancement VSCode
Difficulty 3/5 1-2 days Newbie friendliness 55/100
github/vscode-codeql#4432 · 1 comment ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 64/100
github/vscode-codeql#4339 · 1 comment ·
All issues in github/vscode-codeql
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·