2

I'm sending reports to my sonarqube instance in order to analyse my code for testing coverage and quality/security issues.

My project has 12 different flavours (12 different apps with the same core codebase). There are some classes in the flavour folders which replace the ones from the main folder.

One class, named SignupFragment, resides in all the flavour folders, thus having 12 different versions.

For this class, sonarqube task fails with this message:

* What went wrong:
Execution failed for task ':app:sonarqube'.
> Line 30 is out of range in the file src/mama/java/com/giorgos/section/stampcard/ui/fragment/SignupFragment.java (lines: 6)

Weird thing is that none of the flavours/versions of this class has 30 lines. The biggest one has 15 lines of code.

Any ideas what is wrong ?

I'm using Sonarqube 5.6.2 on a mac and sending my android code reports via a gradle task.

PS: For now I added an exclusion rule to ignore this class, but I would like to figure out an actual solution.

Edit: I tried with Sonarqube 6.3.1 and problem remains.

Edit2: I'm using in Sonarqube the SonarJava plugin 4.5.0.8398 (the one that comes out of the box) and in my build.gradle the gradle plugin org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.

giorgos.nl
  • 2,704
  • 27
  • 36
  • Please [edit] your question to include the version of the SonarJava analyzer (plugin) you're using. BTW, this is not a request for your Java version, but for the version of the plugin. :-) – G. Ann - SonarSource Team May 16 '17 at 11:31

1 Answers1

0

In my recent experience this problem is caused by the jacocoTestReport task writing its report into the same location for all flavors, with the result being that the last one is the only one present when the sonarqube task runs. The source doesn't match up with the coverage report.

John Michelau
  • 1,001
  • 8
  • 12