JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
General

Build/Analysis Commands

CodeSonar provides the build and analyze commands so that you can base a CodeSonar build of your project on whichever build system you are accustomed to using.

This method can be used for building:



General Form

The general form of the command line to build and analyze a CodeSonar project is:

codesonar analyze /path/to/pfiles-name [-project [/[ancestors/]]proj-name] [<other_flags>] [command]

To accumulate components toward a CodeSonar project without finalizing or analyzing it, use:

codesonar build /path/to/pfiles-name [-project [/[ancestors/]]proj-name] [<other_flags>] command

where:

/path/to/
is the path to the project directory, where the project files will be stored. If no path is specified, project files will be stored in the working directory.
pfiles-name
is used to construct file names for the project files generated by CodeSonar.
proj-name
is the CodeSonar project name. If -project is not specified, the project name defaults to pfiles-name.
[<other_flags>]
are any other optional CodeSonar build flags used.
command
is the command line identifying the software on which the project will be based. This varies depending on the language of the software to be analyzed. See the language-specific project build documentation for full details.

Build/Analysis Methods

analyze

Build a CodeSonar project, run the analysis and output the analysis results to a hub (from which they can be browsed using the Web GUI).

codesonar analyze /path/to/pfiles-name [-project [/[ancestors/]]proj-name] [<other_flags>] command
codesonar analyze /path/to/pfiles-name [-project [/[ancestors/]]proj-name] [<other_flags>]

[<other_flags>] = [-foreground] [-wait] [-clean] [-clean-backend] [-force-base-hub-analysis] [-name analysis-name] [-preset preset-name] [-no-default-presets] [-conf-file extra-conf-path] [-property propkey propval] [-launchd-group ldgroup] [-launchd-key ldkey] [-watch-pid pid] [-watch-all-pids] [<authflags>] [-remote analysis-launchd] [-remote-archive archive-launchd] [-srcroot basedir] [[protocol://]host: port]
[<authflags>] = [-auth authtype] [-hubuser username] [-hubpwfile pwfile] [-hubbearerfile bearerfile] [-hubcert certfile] [-hubkey privatekeyfile]

build

Accumulate different components toward a single project without analyzing the project.

codesonar build /path/to/pfiles-name [-project [/[ancestors/]]proj-name] [<other_flags>] command

[<other_flags>] = [-clean] [-clean-backend] [-force-base-hub-analysis] [-name analysis-name][-preset preset-name] [-no-default-presets] [-conf-file extra-conf-path] [-property propkey propval] [-launchd-group ldgroup] [-launchd-key ldkey] [-watch-pid pid] [-watch-all-pids] [<authflags>] [protocol://host:port]
[<authflags>] = [-auth authtype] [-hubuser username] [-hubpwfile pwfile] [-hubbearerfile bearerfile] [-hubcert certfile] [-hubkey privatekeyfile]

Behavior

The effects of codesonar build and codesonar analyze depend on multiple factors. Suppose the project is named pfiles-name.

Overview of project build/analysis states

The following diagram provides an overview of the possible states of a CodeSonar project, and the transitions between these states.

transition diagram (description follows in text): transitions between various states of the Project Build Directory

Project State Description
Empty (E) An empty project is one that has no accumulated information.
To check if your project is in this state, inspect the project build directory pfiles-name.prj_files/.
  • If the directory does not exist at all, the project is always considered to be empty.
  • Otherwise, the project is considered to be empty if it contains zero translation units.
There is only one useful operation from this state: accumulating project information (E→P).
Partially Built (P) A partially built project is one for which information about at least one software component has been accumulated.
To check if your project is in this state, inspect the contents of the project build directory pfiles-name.prj_files/.
  • It will contain a file named 0.*.fe.store.
  • It will not contain file pfiles-name.linked
There are three possible operations from this state.
  • Clean out the accumulated information and start again from an empty project (P→E).
  • Accumulate more information (P→P).
  • Finalize the project and perform the analysis (P→A).
Finalized and Analyzed (A) At the end of a successful codesonar analyze invocation, the project analysis directory contains a fully built and analyzed CodeSonar project.
To check if your project is in this state, inspect the contents of the project build directory pfiles-name.prj_files/.
  • It will contain file pfiles-name.linked
There are three possible operations from this state.
  • Clean out the accumulated information and start again from an empty project (A→E).
  • Accumulate more information (A→P).
  • Reanalyze the same finalized project (A→A).
    (For example, because you want to change a configuration file setting, or adjust the set of applied plug-ins.)

The following sections provide detailed information about the behavior of codesonar build and codesonar analyze in each of these states.

build/analyze on an empty project (E)

The following diagram depicts the effects of codesonar build and codesonar analyze commands invoked when a CodeSonar project is in its initial, empty state.
Command line elements that do not affect the transitions shown in the diagram are omitted for clarity. When the project is in an empty state, this includes the -clean option.

transition diagram (description follows in text): build/analyze command from empty project state

build/analyze on a partially-built project (P)

The following diagram depicts the effects of codesonar build and codesonar analyze commands invoked when a CodeSonar project is in partially built state.
Command line elements that do not affect the transitions shown in the diagram are omitted for clarity.

transition diagram (description follows in text): build/analyze command from partially-built project state

build/analyze on a finalized, analyzed project (A)

The following diagram depicts the effects of codesonar build and codesonar analyze commands invoked when a CodeSonar project is in fully built, analyzed state.
Command line elements that do not affect the transitions shown in the diagram are omitted for clarity.

transition diagram (description follows in text): build/analyze command from analyzed project state

 

To report problems with this documentation, please visit https://support.codesecure.com/.