Graph viewer: edges ordered by wrong attribute

Đang mở
#1,332 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện truy vấn đồ thị trong issue và xác định mã của trình xem đồ thị áp dụng semmle.order cho các nút và cạnh. Xác nhận rằng các nút gốc vẫn được sắp xếp theo thứ tự giảm dần, trong khi mỗi tập hợp các nút con tuân theo thứ tự tăng dần của vị từ cạnh, sau đó thêm hoặc cập nhật một bài kiểm thử hồi quy nếu dự án có phạm vi kiểm thử cho việc sắp xếp đồ thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
539
Fork
240
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
29

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/vscode-codeql

Tất cả issue của github/vscode-codeql

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.