General

codesonar analysis_id.py: Print Analysis ID from the Specified Analysis Directory

The codesonar analysis_id.py command prints (to stdout) the analysis ID for the most recent analysis performed in a given analysis directory.


Overview

The codesonar analysis_id.py command prints (to stdout) the analysis ID for the most recent analysis performed in a given analysis directory.

This is useful when you are performing an automated task that needs an analysis ID to access analysis information on the hub. For example, all of the example scripts for downloading analysis warnings, changing an analysis name, and deleting an analysis require an analysis ID to identify the analysis of interest.

Command Line

The standard form of the command line is:

codesonar analysis_id.py path/to/projname.prj_files [-strip]

The subcommand will also accept the path to the corresponding .prj file, or the path with the .prj_files extension omitted:

codesonar analysis_id.py path/to/projname.prj [-strip]
codesonar analysis_id.py path/to/projname [-strip]

where:

path/to/projname.prj_files
or
path/to/projname.prj
or
path/to/projname
Specify that the analysis directory for the analysis of interest is path/to/projname.prj_files.
[-strip] Specify that CodeSonar should not print a newline after the analysis ID.
This option can be convenient when you are using codesonar analysis_id.py in a bash shell subprocess on Windows.

Examples