Code displayed in Issues is not updating even after the code in git has changed

Version:

  • Enterprise Edition
  • Version 8.9 (build 43852)

Problem statement:

When I go to issues and view where in the code the issue is occurring the code has not been updated. As an example I’m using the master branch only for this project and I have changed the following code as follows

What’s in Git

public class R7Asset {

  @JsonProperty("id")
  private Integer id;
  @JsonProperty("ids")
  private List<R7Id> ids = new ArrayList<>();
  @JsonProperty("assessedForPolicies")
  private Boolean assessedForPolicies;
  @JsonProperty("assessedForVulnerabilities")
  private Boolean assessedForVulnerabilities;
  @JsonProperty("configurations")
  private List<R7Configuration> configurations = new ArrayList<>();

what’s in Sonar

public class R7Asset {
    @JsonProperty("addresses")
    private List<R7Address> addresses = new ArrayList<R7Address>()
    @JsonProperty("assessedForPolicies")
    private Boolean assessedForPolicies;
    @JsonProperty("assessedForVulnerabilities")
    private Boolean assessedForVulnerabilities;
    @JsonProperty("configurations")
    private List<R7Configuration> configurations = new ArrayList<R7Configuration>();

I’ve seen this occur now in two old projects. I tried to create a new project and reproduce and everything was fine in the new project. I also tried it on a project that’s 18 months old and still unable to reproduce.

There is no workaround that I’ve found. I deliberately changed the code formatting to see if it would trigger something and it didn’t. I also resolved the issue in Sonar to see if it would trigger something and it didn’t.

The upshot of this is we cannot trust the numbers we’re getting from Sonar and we have thousands of projects using it for quality gates during the build.

Hi,

Can you share your analysis logs?

 
Ann

Is this the correct logs?

compute_logs.txt (8.3 KB)

Hi,

That’s the server-side log. I’m looking for the build agent log.

 
Ann

I think we might have found the problem. The SCM sensor is turned off. This gets flagged in the logs as

WARN: Missing blame information for the following files:

and the files listed are the ones whose code is not being updated. We’re going to enable the SCM sensor tonight and rebuild to see if this fixes the problem.

1 Like