Need connection between hotspot selected and code listing

SQ 8.6.0 – accessing web portal using Chrome 88.

When I go to the Security Hotspots tab, the left frame is a list of hotspots. Since these are grouped by type, often there is a large group of identical boxes with absolutely nothing to distinguish one from the other. When I click on one, the frame on the right shows the offending code. But the box I clicked on the left isn’t highlighted or given any indication that it is the one corresponding to the code on the right.

So I look at the code, then go back to the left to go to the next one. Now which one did I click? I don’t know – there is absolutely nothing to distinguish one from the other!

Oh, and when you click on a box on the left, it usually MOVES so that a DIFFERENT box is now highlighted. So something simple like putting a sticky note on my screen next to the box I select won’t work.

Hi @MisterPi,

I am having a hard time understanding what your problem is. Could you please provide me with screenshots?

AFAIK, the selected hotspot is well displayed (Chrome 88).

image

Cheers

Well, your screenshot clearly illustrates the problem (so it’s not just a config issue with my browser). All the boxes (with the strcpy hotspot in this example) are completely identical.

Yes, one of them is highlighted (blue border). But as soon as you move the cursor to the right frame to look at the hotspot in detail, the highlight disappears. So now you want to look at the next hotspot. Which one is “next”?

This doesn’t happen with the Issues screen. The box remains bordered when moving to the right frame to look at the code.

There is nothing on the screen that tells me which box on the left is the one being displayed on the right. If you numbered them, and put the numbers in the boxes and also on the frame on the right, that would make it a lot easier to use.

Hi @MisterPi,

This is interesting. I can confirm that it works properly for me (Ubuntu / Chrome 88). Let’s try to understand why you lose the highlight, shall we?

  1. I understand that you’re using Chrome 88, am I right?
  2. What your SonarQube edition?
  3. Any particular plugin installed on your SonarQube instance?
  4. What is your OS?
  5. Is there anything interesting showing up in the browser console while this is happening?
  6. Could you try to create a small gif/video of the issue?

Cheers

I played around with this, and I think I know what’s happening.

It turns out the highlight remains there. In a typical use scenario, I look at a hotspot, then I want to look at the next one, so I go back to the left frame, and then click on the box below the highlighted one. When I do this, there is a lot of motion in the left frame. It appears to scroll down past several hotspots, enough to make the highlighted box go up past the top of the screen. It happens so quickly that it looks like the highlight just disappears, but in fact if I use the scroll wheel on the mouse I can move up about half a screen and the highlighted box is still there. The code that now appears in the right frame seems to be the “next” hotspot – if I then click on the box above the newly-highlighted one (i.e., the one that was highlighted before) then I can see by the line numbers that the right frame shows the hotspot I originally started on.

So the question is: why does it do this odd scrolling behavior? Note that this doesn’t happen with issues. You click on the next box on the left when looking at issues, and nothing on the left moves (except to highlight the new box) and the frame on the right changes to the new issue.

Your questions:

  1. Yes – but I tried on Firefox 85.0.2 and that also has the problem.
  2. 8.6.0
  3. I don’t think so. It was an out-of-the-box install.
  4. The browser runs on Windows 10 v. 1910; the SQ server runs on Server 2012 r2.
  5. When the mouse is over the box on the left, there is a tip box in the lower left corner of the browser window giving what appears to be a URL, something like “[server URL]/sonar/security_hotspots?id=[project-key]#” and there is nothing past the # at the end. Nothing else that I would consider interesting.
  6. Our sysadmins have locked that down.

So I’m guessing that the left frame for hotspots is trying to do some kind of recentering (perhaps to make the box just selected appear in the middle of the list, so the user doesn’t need to reposition every few issues as with the issues tab), but that it’s broken somehow.

1 Like

Indeed the hotspot list is trying to put the selected hotspot at a convenient place. Which seems to work well most of the time.

May I ask what is your screen resolution? Do you use Chrome/Firefox zoom feature (CTRL + ‘+’)?

1680x1050, with the “Change the size of text, apps and other items” setting at 150%. So you are saying the recentering isn’t done for the list frame for issues?

I’m not a webpage guru, but it would seem to me that attempting to recenter in that way requires detailed information about how the page renders on a specific user’s screen and is prone to miscalculation. Is there a way to disable this, either through the portal or conf/sonar.properties?

No this isn’t what I’m saying. There’s a centering process too for issue.

No there is no way to disable it.


I’ve logged the issue in this JIRA ticket. Feel free to watch it to track progress on it.

Thanks for you report and for the time you allowed to our discussion.

Cheers

Ah yes, I see now. The issue list frame does recenter, but only if you get “too close” to the top or bottom – and then it doesn’t move the selected issue to the exact center, but only moves enough to get it into roughly the middle half of the frame (between 1/4 and 3/4 of the distance from the top).

So the security hotspot frame should work the same way – but doesn’t…