"Measures/Size/Lines Of Code" not equal "Project Information/Lines of Code"

Under “Measures” and “Size” the section “Lines of Code” does provide concrete numbers for lines, however, at the same time, the project overview information under “Project Information” does show: “Lines of Code: 0”. Why? What can be a reason for this, please?
Thank you.

Hello Michael,

Can you post some screenshots of what you’re seeing? Did the project overview ever show anything non-zero?

Hi Jeff.
No, it did not show anything else until now. It is not possible to make screenshots. Please let me know if you are interested in any specific information you do not have already. One question: how is the “lines of code” metric in the “project information” area calculated? Is it always derived from the Master, by accident or by purpose? In my case, the Master right now has 0 lines of code, however, for a branch the data also shows zero although the data for that branch under “measure”>“Size”>“Lines of Code” shows reasonable values. Version in use is 8.3.1 (Developer Edition).

Thank you.
Michael

The Project Information always shows the main branch of the project, ‘master’ by default. So if the master has 0 lines of code, a display of 0 is expected. However, i’d expect what you see under Measures to match this. You’re certain you’re comparing with the Measures tab also on the main branch, or only after you switch to another branch?

Hi Jeff.
Yes, I feel comfortable in switching the visual controls as well as the branches. The project Information also lists applied quality profiles. They vary between branches, whereas the LOC always shows zero. Yes, I can confirm that the Measures data are correctly reflecting the actual LOC.
Is this a bug?

Michael

I’m confused by that statement. What vary between branches?

I am starting to wonder if you could be suffering from a corrupt/stale search index. Is yours a traditional server deployment, or are you using Docker…? Can your SonarQube instance be taken offline for a little while while we try an experiment?

Hi Jeff.
What your tool is showing which quality profiles are used, under “Project Information”, is varying between branches. I guess the used quality profiles depend on what artifacts are found on one specific branch. No, sorry, it is not possible to take off the installation.
I’m continuing to experiment.
Thanks.
Michael

Hi Jeff, hi team,
now code is on the Git Master as well, and now the LoC metric is shown correctly under “Project information”. Looks like the current behavior of your tool is that always the LoC Git Master is shown even if you select to show the results of a specific branch . Is this by purpose, or by accident? Other data under “project information” do indeed depend on the analyzed Git branch, particularly the used “Quality Profiles”. thank you.
Michael

Hey Michael,

Looks like when we moved the Project Information into a side-drawer (around v8.2), the LoC count stopped being branch-aware (all the data is right in the backend, we just call the API without a branch parameter). I’ve pinged internally to see if this was intentional.

Best regards,

Colin

Hi Colin.
Yes, from a user perspective it looks a bit like that the LoC metric in the Project Information is supposed to be branch-aware, but it is not, or there is any intention that is not very intuitive. Thanks for taking care.

Michael

Hey Michael,

SONAR-13876 is created to make this branch-aware again. Thanks for the report.