class analysis_mode

Enumeration class describing the mode of a CodeSonar analysis process.

analysis.get_mode() returns an object of this class.

analysis_mode Details

class cs.analysis_mode

Enumeration class describing the mode of a CodeSonar analysis process.

static from_integer(_inner)

Construct an instance from an integer representation.

Parameters:_inner (int) – The integer representation, as returned by analysis_mode.as_integer().
Return type:analysis_mode
Raises:result.ERROR_INVALID_ARGUMENT if _inner is not a valid integer representation for a analysis_mode instance.

Invariant: For analysis_mode x, analysis_mode.from_integer(x.as_integer()) == x

>>> analysis_mode.from_integer(3)
<cs.analysis_mode daemon>
__cmp__(other)

Comparison function for analysis_mode , with respect to a stable overall ordering.

Parameters:other (analysis_mode) – The analysis_mode object to compare against.
Return type:int
Returns:An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if self < other
  • N>0 if self > other
analysis_mode.INITIALIZING.__cmp__(analysis_mode.INCREMENTAL)
-1
__eq__(b)

Equality operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:True if self and b compare equal, False otherwise.
>>> analysis_mode.NORMAL == analysis_mode.INCREMENTAL
False
__ge__(b)

Greater-than-or-equal operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:True if self >= b , False otherwise.
>>> analysis_mode.INITIALIZING >= analysis_mode.DAEMON
False
__gt__(b)

Greater-than operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:True if self > b , False otherwise.
>>> analysis_mode.NORMAL > analysis_mode.INCREMENTAL
False
__hash__()

Hash function for analysis_mode .

Return type:int
>>> hash(analysis_mode.INITIALIZING)
0
__le__(b)

Less-than-or-equal operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:True if self <= b , False otherwise.
>>> analysis_mode.DAEMON <= analysis_mode.NORMAL
False
__lt__(b)

Less-than operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:True if self < b , False otherwise.
>>> analysis_mode.NORMAL < analysis_mode.INCREMENTAL
True
__ne__(b)

Inequality operator for analysis_mode .

Parameters:b (analysis_mode) – The analysis_mode object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> analysis_mode.DAEMON != analysis_mode.INITIALIZING
True
__repr__()

Get a representation of a analysis_mode object that includes information useful for debugging.

Return type:str
Returns:The string representation.
>>> repr(analysis_mode.DAEMON)
'<cs.analysis_mode daemon>'
__str__()

Get a simple string representation of a analysis_mode object.

Return type:str
Returns:The string representation.
>>> str(analysis_mode.INITIALIZING)
'initializing'
as_integer()

Get an integer representation of self.

Return type:int
Returns:An integer suitable for use with analysis_mode.from_integer().

Invariant: For analysis_mode x, analysis_mode.from_integer(x.as_integer()) == x

>>> analysis_mode.DAEMON.as_integer()
3
name()

Get the name of a analysis_mode object.

Return type:str
Returns:The name.
>>> analysis_mode.NORMAL.name()
'normal'
DAEMON

Indicates that the CodeSonar process is not analyzing anything - it is only running to service requests from the hub (for example, requests for source code listings).

>>> analysis_mode.DAEMON
<cs.analysis_mode daemon>
INCREMENTAL

Indicates an incremental analysis: only new and otherwise-affected parts of the program are being analyzed; state associated with no-longer-present bits of the program may be deleted.

>>> analysis_mode.INCREMENTAL
<cs.analysis_mode incremental>
INITIALIZING

The CodeSonar process always starts in this state.

If this value is returned by analysis.get_mode(), it means that the function call occurred too early to get useful information.

>>> analysis_mode.INITIALIZING
<cs.analysis_mode initializing>
NORMAL

Indicates a nonincremental analysis ( INCREMENTAL_BUILD =No) or base analysis ( INCREMENTAL_BUILD =Yes and no parent analysis).

>>> analysis_mode.NORMAL
<cs.analysis_mode normal>