diff --git a/v2/metric/environmental.go b/v2/metric/environmental.go index ed3a282..9bd4c08 100644 --- a/v2/metric/environmental.go +++ b/v2/metric/environmental.go @@ -195,7 +195,7 @@ func (m *Environmental) Score() float64 { if m.IsEmpty() { return adjustedTemporal } - return roundTo1Decimal(adjustedTemporal + (10-adjustedTemporal)*m.CDP.Value()*m.TD.Value()) + return roundTo1Decimal((adjustedTemporal + (10-adjustedTemporal)*m.CDP.Value()) * m.TD.Value()) } // Severity returns severity by score of Environmental metrics diff --git a/v2/metric/metric_test.go b/v2/metric/metric_test.go index ffbe418..e7e16fb 100644 --- a/v2/metric/metric_test.go +++ b/v2/metric/metric_test.go @@ -262,6 +262,13 @@ func TestEnvEnvironmentalScore(t *testing.T) { temp: 1.5, env: 1.5, }, + { + name: "issue-33d", + vector: "AV:A/AC:M/Au:S/C:C/I:C/A:C/CDP:N/TD:N/CR:M/IR:ND/AR:L", + base: 7.4, + temp: 7.4, + env: 0.0, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {