Cannot see only modified lines of code

Hello,

Can someone help on this request to see newly added/modified lines of code in new sonarqube version?

I am currently using sonarqube 7.9.5 LTS version with enterprise edition, where we have a option called source branch and target branch where analysis will be very clear like below


It is a feature branch code analysis which compare with the master branch analysis and clearly shows me what are all bugs/vuln’s were introduced with the new code. If click on code tab I would see like below

In feature branch code tab:


This is very clear that only 1st and 4th folders code changed and lines of code changed is 171 in 1st folder code 38 in 4th folder code.

The same analysis in master branch looks like below as it is target branch

Here is the question… When I was doing in POC to update the SonarQube to 8.6 version… I couldn’t see in detailed view.

  1. I know that in latest version there is no more target branch, where it is not considering the master branch to compare the analysis
  2. My development teams wanted to see the detailed view like above where it is very clear to understand what are lines changed and Bugs/Vuln’s are introduced with those modified lines code.

In latest version of sonarqube we are seeing full lines of code in feature branches as well (like it shows in 7.9.5 master branch) which is really causing the confusion to know the only modified files.

Please help me in having the detailed view like LTS version

Hi,

With the drop of the feature/short-lived branch concept, you no longer have access to “branches” that show only new code. What you have instead in the latest version is a much-improved Pull Request analysis experience. And it’s there that you get the Code view isolated to only New Code:

 
HTH,
Ann

Hi Ann,

We are currently using Bitbucket server and Teamcity for CICD, could you please share more details if possible how to integrate and all?

Currently in my teamcity we are not building any PR branches, we tried one and pushed analysis report to sonarqube, latest version sonar is still showing PR as a branch

image

even though we click on manage branches & pull requests we are not able to see any data

Is there anything needs to change on sonar scanner to push metrics as a PR? if yes could you share those steps?

Hi,

This is going to be about the parameters that identify a given analysis as being of

  • main
  • a non-main branch
  • a PR

We don’t support TeamCity, but our docs on the Bitbucket integration may help.

 
Ann