SonarCloud not scanning code when sonar.inclusions is defined

Hi,

When I see the sonar.inclusions property, the code section in sonarcloud is empty. When I do not define the sonar.inclusions property, the code section in sonarcloud isn’t empty, but only assets are shown, and no .vue, .js and .ts files are shown, the folder name matches the name of the actual folder.

This is my sonarcloud prepare:

      - task: SonarCloudPrepare@3
        inputs:
          sonarCloud: SonarCloud
          organization: {{ORGNAME}}
          scannerMode: CLI
          configMode: 'manual'
          cliProjectKey: {{PROJECT_KEY}}
          cliProjectName: {{PROJECTNAME}}
          cliSources: '$(System.DefaultWorkingDirectory)/{{FOLDER_NAME}}/src/'
          extraProperties: |
            sonar.inclusions=**/*.js,**/*.ts,**/*.vue
            sonar.javascript.lcov.reportPaths={{FOLDER_NAME}}/coverage/lcov.info

In the master branch it DOES show everything- but in the DEV branch, it only shows a few files (none code files) and in a descending branch of DEV - it shows a few code files, but not everything - I have literally no clue what’s going on, is there anyone who can help?

Hey there.

It sounds like you are analyzing a short-lived branch, where the only code that will be displayed is the code that has changed in that branch. If you want to show everything on that branch, you’ll need to delete the branch, adjust the long-lived branch name pattern for your project, and reanalyzed the branch.