-1

Steps:

  1. Installed coverity
  2. Configured compiler
    cov-configure --javascript
    cov-configure --cs
  3. I am stuck at the build step of cov-build. Yarn is used to run and configure the service. But I am not sure what coverity wants here.

I tried a couple of npm run commands, every time end up getting this:

[WARNING] No files were emitted. This may be due to a problem with your configuration or because no files were actually compiled by your build command. Please make sure you have configured the compilers actually used in the compilation.

I also tried different compilers, but no luck. What should be done in this case?

SRENG Khorn
  • 1,201
  • 1
  • 12
  • 22

1 Answers1

0

You need to do a file system capture for Javascript files. You can accomplish this by running cov-build with the --no-command flag.

cov-build --dir CoverityIntermedediateDir --no-command --fs-capture-list list.txt

Lets break down these commands:

  • --dir: intermediate directory to store the emitted results (used for cov-analyze later).
  • --no-command: Do not run a build command and to look for certain file types
  • --fs-capture-list: Use the file that is provided to specify which files to look at and possibly emit to the intermediate directory.

A recommended way to generate the list.txt file is to grab it from your source control. If using git run:

git ls-files > list.txt

I want to also point out that if you don't have a convenient way to get a file listing in order to use the --fs-capture-list command you can use --fs-capture-search command and pair that with a filter to exclude the node_modules directory.

The coverity forums have some useful questions and answers: Node.js File system capture

Really, the best place to look is at the documentation. There are several examples of what you want to do in their guides.