English fallback
This translation is missing; the canonical English reference follows.
fuzzy1337.intelligence_cvss2_base¶
Experimental pure CVSS 2 base calculation accepts only original immutable
CveCvss2Statements, retaining the source inspection once with a separate
ordered frozen calculation per assessment. Each value has its assessment
position, algorithm cvss2-base-2.10 and integer score in tenths; the public
constructor accepts no calculated fields. DisplayScore() renders exactly one
decimal digit.
Exact integer arithmetic implements FIRST equation 2.10 with final rounding only, an explicit zero-impact branch, and no intermediate rounding or impact clamping. Source vectors, asserted scores, context and snapshot bytes remain unchanged. Optional metrics do not create temporal/environmental results. No source correction, severity conversion, target matching, network execution or publisher authentication follows.
docs/INTELLIGENCE_CVSS2_BASE.md and ADR 0107 define the bounded calculation
contract, finite-domain rounding evidence and separate source/derived output.
fuzzy1337.intelligence_cvss2_base
¶
Derive immutable CVSS 2 base scores separately from unchanged source assertions.
BaseCalculation
dataclass
¶
Keep one internally derived value linked only by its source assessment position.
Source code in fuzzy1337/intelligence_cvss2_base.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
DisplayScore() -> str
¶
Render exact integer tenths without floating-point or Decimal conversion.
Returns:
| Type | Description |
|---|---|
str
|
Score with exactly one decimal digit, including 0.0 and 10.0. |
Source code in fuzzy1337/intelligence_cvss2_base.py
70 71 72 73 74 75 76 77 | |
ToDict() -> dict[str, object]
¶
Return a detached derived value without repeating source assertions.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Assessment position, algorithm identifier and integer score in tenths. |
Source code in fuzzy1337/intelligence_cvss2_base.py
79 80 81 82 83 84 85 86 87 | |
CveCvss2BaseCalculations
dataclass
¶
Compute Experimental base-only values while retaining original typed statements once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statements
|
CveCvss2Statements
|
Original immutable source inspection; no raw input or score coercion occurs. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
Input is not a typed CveCvss2Statements value. |
Calculation is pure. Source scores, snapshot bytes, provider/scenario contexts and their positions remain unchanged. No applicability, severity or source-correction verdict follows. Computed fields are not constructor arguments. Direct source construction retains the original inspection API's limit: it cannot independently prove derivation from raw bytes.
Source code in fuzzy1337/intelligence_cvss2_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
__post_init__() -> None
¶
Require typed statements and derive one immutable value per assessment in order.
Source code in fuzzy1337/intelligence_cvss2_base.py
109 110 111 112 113 114 115 116 117 118 119 | |
ToDict() -> dict[str, object]
¶
Return detached source inspection once and a separate ordered calculation array.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Unchanged statements and computed-only base values; no persisted decoder is defined. |
Source code in fuzzy1337/intelligence_cvss2_base.py
121 122 123 124 125 126 127 128 129 | |
BaseScoreTenths(assessment: CveCvss2Assessment) -> int
¶
Evaluate FIRST equation 2.10 exactly, rounding only the final number of tenths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assessment
|
CveCvss2Assessment
|
Already validated immutable source metric containing all six base tokens. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Integer tenths in 0..100, independent of optional metrics and asserted scores. |
Source code in fuzzy1337/intelligence_cvss2_base.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |