Problem with sonarcloud scanning repo with Javascript and Typescript

Hello everybody! I have repos where store files for nodejs, and also .java files which used for building .apk file. So, the scanning our java files was successfull, but I think that we must do the same to the reac-native code - cause the main configuration of our application was written ion react. For this purpose I use another job, and inserted via CLI in bitbucket-pipeline needed values, below arg in my pipeline:

step:
    name: Scan source code for bugs, security threats
    caches:
      - "sonar"
    script:
      - pipe: sonarsource/sonarcloud-scan:1.4.0
        variables:
          SONAR_TOKEN: $SONAR_TOKEN
          EXTRA_ARGS: '-Dsonar.projectKey="$PROJECT_KEY" -Dsonar.sources="$SONAR_SOURCE" -Dsonar.language="ts" -Dsonar.exclusion="$SONAR_EXCLUSION"'
          SONAR_SCANNER_OPTS: -Xmx512m
          DEBUG: "false"

in exclusion I have pattern like **/*.java - to exclude java files
in sonar sources I have path: src

So, my question is - why I haven’t anything in code lines after succesfull execution of pipeline ?
Attach screen with code lines chapter and logs which I suggest confused.


pipelineLog-{7cdf3028-2d78-4ec6-98f7-e207fa28f779}.txt (18.1 KB)

Hey there.

Here you’re scanning a pull request, which will only show lines of changed code. If all you have changed here is a YAML file, it won’t be represented as there’s no new code.

Once you merge the action into your main branch, the main branch should be analyzed and you’ll have full results.

Thank’s Colin !
But I don’t do pull request, I just scan branch with name “testing”. So, you tell me if I scan main branch - I see all code lines which scan ? It’s strange for me, because I scan at the same type in others repo’s in not main branch and I see all code lines after scan. Its really strange …

Hey there.

Here it looks like you’re analyzing a short-lived branch, which behaves the same as a pull request for these purposes (only showing issues on changed lines of changed files). If all you have changed is a configuration file, there’s no change in the code to show.

Hey there!
thank’s, I will try :slight_smile: