Error executing command: Cannot run program "shellcheck": error=2, No such file or directory

  • Sonar scanner for gradle: org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.5.0.2730
  • Running in gitlab and reporting to SonarQube Enterprise Edition Version 9.9.1 (build 69595)

I’m trying to run a multi-module scan of a java and angular/typescript application.

After much trial and error I finally have scan results for the code locations desired, however, the problem I run into is part of the typescript scan. ts files are recognized but do not show any scan results in my sonarqube project.

The gitlab log shows the following:

Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
Missing blame information for the following files:
  * libs/archive/src/main/java/com/parsons/centralserver/archive/controller/ArchiveController.java
  * core/browser-client/src/app/interceptors/etag.interceptor.spec.ts
... [many many more ts and java files]

I do not need the blame info, so I’m not put off by that.

Here is my top level sonar block config:

    apply plugin: 'org.sonarqube'
    sonar {
        properties {
            property "sonar.projectKey", "[key]"
            property "sonar.qualitygate.wait", true
            property "sonar.sources", "src/main"
            property "sonar.tests", "src/test"
            property "sonar.verbose", true
            property "sonar.log.level", "DEBUG"
        }
    }

And here is my subproject sonar block config that contains the web app:

    sonar {
        properties { 
          property "sonar.language", "ts"
          property "sonar.sources", "src/app,src/modules" // override/customize sources
        }
    }

I suggest reaching out to the maintainer of GitHub - sbaudoin/sonar-shellcheck: SonarQube plugin to analyze Shell scripts with ShellCheck

Thanks for that. Since my original posting, I have progressed past the shellcheck error and have removed that from my suspicion list (updated the post). Though I’m still searching for the right mix of settings to get a successful typescript scan using the gradle plugin.

Since I cannot find a way to update the title, I’m going to close this posting as solved and create a new post. What I did was to install shellcheck into my build container and the error went away.