class warning_significance

Enumeration class describing the significance setting for a warning class.

warning_significance Details

class cs.warning_significance

Enumeration class describing the significance setting for a warning class.

static from_integer(_inner)

Construct an instance from an integer representation.

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

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

>>> ws = warning_significance.DIAGNOSTIC.as_integer()
>>> ws
5
>>> warning_significance.from_integer(ws)
<cs.warning_significance diagnostic>
__cmp__(other)

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

Parameters:other (warning_significance) – The warning_significance 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
>>> warning_significance.FROM_MANIFEST.__cmp__(warning_significance.SECURITY)
-1
__eq__(b)

Equality operator for warning_significance .

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

Greater-than-or-equal operator for warning_significance .

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

Greater-than operator for warning_significance .

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

Hash function for warning_significance .

Return type:int
>>> hash(warning_significance.STYLE)
4
__le__(b)

Less-than-or-equal operator for warning_significance .

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

Less-than operator for warning_significance .

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

Inequality operator for warning_significance .

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

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

Return type:str
Returns:The string representation.
>>> repr(warning_significance.DIAGNOSTIC)
'<cs.warning_significance diagnostic>'
__str__()

Get a simple string representation of a warning_significance object.

Return type:str
Returns:The string representation.
>>> str(warning_significance.STYLE)
'style'
as_integer()

Get an integer representation of self.

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

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

>>> ws = warning_significance.DIAGNOSTIC.as_integer()
>>> ws
5
>>> warning_significance.from_integer(ws)
<cs.warning_significance diagnostic>
name()

Get the name of a warning_significance object.

Return type:str
Returns:The name.
>>> warning_significance.RELIABILITY.name()
'reliability'
DIAGNOSTIC

diagnostic: warnings of this class do not indicate vulnerabilities, they indicate the locations of events or artifacts of interest.

>>> warning_significance.DIAGNOSTIC
<cs.warning_significance diagnostic>
FROM_MANIFEST

Use this when creating a warning class to denote that the significance is to be read from the manifest: any significance value provided to the warning class creation function is ignored.

>>> warning_significance.FROM_MANIFEST
<cs.warning_significance unspecified>
REDUNDANCY

redundancy: redundant code; may indicate a logic error.

>>> warning_significance.REDUNDANCY
<cs.warning_significance redundancy>
RELIABILITY

reliability: a code correctness issue.

>>> warning_significance.RELIABILITY
<cs.warning_significance reliability>
SECURITY

security: a security vulnerability.

>>> warning_significance.SECURITY
<cs.warning_significance security>
STYLE

style: a violation of one or more coding guidelines.

>>> warning_significance.STYLE
<cs.warning_significance style>
UNSPECIFIED

No significance value was specified.

>>> warning_significance.UNSPECIFIED
<cs.warning_significance unspecified>