Sonarqube gradle exlusions invalid

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube * Enterprise Edition Version 10.3 (build 82913
    android studio. use gradle
  • what are you trying to achieve
    I hope my test folder will not be scanned
  • what have you tried so far to achieve this
    I added property “sonar.exclusions”, “/build/,/androidTest/,/*.xml” to my gardle
    Add this property to the sonar-project.properties file in the ios project, and it will also work well.
    But in the current SonarQube * Enterprise Edition Version 10.3, I added it to the android project and scanned it. I can still find this folder in the code on the website.
    In particular, the line of code is displayed -, and there are three other problems with code smells. You can actually click in to see the actual program code. This is obviously different from the sonar.exclusions results I did in the iOS project and in previous versions.
    Even if I also point the source directly to the directory I want to scan, the folder still appears.
    My folder actually looks like this: There are main and androidText under the src directory.
    I also added property “sonar.sources”,“src/main” this androidtest will also appear

Hi,

Welcome to the community!

Are you concerned that it’s completely excluded from analysis, or that it’s not analyzed as source code? Because if you use sonar.tests to tell analysis that it contains test files, it will still be analyzed, but not as source code. And in case your concern is licensing LOC, I should note that test files are never counted toward LOC.

If it’s that you want it completely excluded from analysis, can you post your analysis configuration and full analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann