github / vscode-codeql

An extension for Visual Studio Code that adds rich language support for CodeQL
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-codeql
MIT License
419 stars 183 forks source link

Feature request: Display length of shortest path in UI #3659

Open p- opened 2 months ago

p- commented 2 months ago

Is your feature request related to a problem? Please describe.

When using MRVA with a query (custom or default) that yields a lot of results it is often hard to figure out which of the results are the most promising ones. Only after clicking on "Show paths" one learns how long the paths are and likely starts looking at results with a lower path count.

Image

See also: Feature request: allow to limit results by path length in UI

Describe the solution you'd like

It would be nice if the shortest paths for all the results would be displayed in the overview. (For MRVA and maybe also for local queries).

I've hacked this together in my experimental branch and it's already helpful (but not so beautiful 😉 ) - see commit https://github.com/p-/vscode-codeql/commit/20617d2ab821ad71bb766fa73fec016c5287ff63.

Image

Describe alternatives you've considered

An alternative or a nice addition would be if they results were ordered with regards to their shortest path length (shortest length on top).

Additional context

See also: Feature request: allow to limit results by path length in UI

jf205 commented 1 month ago

Hi @p-! Thanks for creating this issue. This change looks useful and is a nice simple UI change. The copy looks fine to me. We would be happy for you to contribute this change to the extension as a pull request and someone on the team will review it. Please let us know when the PR is ready.

p- commented 1 month ago

Hi @jf205 Thanks!

I've created a PR: https://github.com/github/vscode-codeql/pull/3671

p- commented 1 month ago

I've prototyped this for the local queries as well (using a badge due to size constraints). (Commit: https://github.com/p-/vscode-codeql/commit/69a267707e8a11d9d5b5f4aeafa224e07100b70c) Image

@jf205 Should I add the change for local queries to the same PR? (it's only for MRVA at the moment)

/cc @owen-mc

owen-mc commented 1 month ago

I think that looks great with the badges. Though, now that I look at it the screenshot more closely, I realise that it would make more sense (and be more consistent) if the bit that says "Path" indicated the length of the path, so you would know how long it is without expanding it. I thought it did already, but I just double checked and it doesn't. I guess I have muscle-memory to open the top path and see how long it is.