Analyzing a Project

The sample project sample_suppression will be analyzed in this example. The command to do this is:

qacli analyze -f -P <directory>/sample_suppression-<version>

This command line is now explained:

  • qacli - The executable being invoked.
  • analyze - The subcommand being invoked. The analyze subcommand is used to run analyses on existing projects.
  • -f - A switch on the analyze subcommand. This switch dictates that a file-based analysis is to be conducted.
  • -P - A switch on the analyze subcommand. This switch is used to specify the project that is to be analyzed.

Where <sample-location> is the OS specific path to the sample projects:

Linux

~/.config/Perforce/Helix-QAC-<version>/samples

or

Windows

%LOCALAPPDATA%\Helix-QAC-<version>\samples

and <version> is the version of the software - for example: 2021.3.

Executing this command should produce output of the following nature1:

 

src/diff/alloca.c:qac:0:1:13 
src/diff/context.c:qac :0:2:12
src/diff/analyze.c:qac:0:3:11 
src/diff/diff.c:qac:0:4:10 
src/diff/dir.c:qac:0:5:9
src/diff/ed.c:qac:0:6:8
src/diff/diff3.c:qac:0:7:7
src/diff/getopt1.c:qac:0:8:6
src/diff/getopt.c:qac:0:9:5
src/diff/ifdef.c:qac:0:10:4
src/diff/io.c:qac:0:11:3
src/diff/normal.c:qac:0:12:2
src/diff/util.c:qac:0:13:1
src/diff/version.c:qac:0:14:0
src/cgicc/CgiUtils.cpp:qacpp:0:1:10
src/cgicc/CgiEnvironment.cpp:qacpp:0:2:9
src/cgicc/Cgicc.cpp:qacpp:0:3:8
src/cgicc/FormEntry.cpp:qacpp:0:4:7
src/cgicc/FormFile.cpp:qacpp:0:5:6
src/cgicc/HTMLElements.cpp:qacpp:0:6:5
src/cgicc/HTMLAttributes.cpp:qacpp:0:7:4
src/cgicc/MStreamable.cpp:qacpp:0:8:3
src/cgicc/HTTPHeaders.cpp:qacpp:0:9:2
src/demo/upload.cpp:qacpp:0:10:1
src/demo/test.cpp:qacpp:0:11:0

Progress ( FilebasedAnalysis ) :. . . . . . . . . . .done

Each line of the output indicates the file being analyzed, the toolchain being used to conduct the analysis, the toolchain return code for this file’s analysis, and a running count of how many files have been analyzed by that toolchain (and how many remain).

For example, src/cgicc/HTTPHeaders.cpp:qacpp:0:9:2 indicates that the file HTTPHeaders.cpp has been analyzed with the QAC++ toolchain, and the numerical code (0:9:2) indicates that the toolchain process return code for this file’s analysis was zero (success), and that this was the ninth file to be analyzed by this toolchain (with two files remaining to be analyzed).