Skip to content

Commit b42f68b

Browse files
refactor: renaming variable
1 parent c6968cb commit b42f68b

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

csaf_2_1/mandatoryTests/mandatoryTest_6_1_48.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,31 +104,40 @@ export function mandatoryTest_6_1_48(doc) {
104104
s.namespace !== undefined &&
105105
registeredSsvcNamespaces.includes(s.namespace)
106106
)
107-
selectionsWithRegisteredNamespace?.forEach((select, selectionIndex) => {
108-
// check if a decision point with these properties exists
109-
const selectedDecisionPnt = decisionPointMap.get(
110-
decisionPointHash(select.name, select.namespace, select.version)
111-
)
107+
selectionsWithRegisteredNamespace?.forEach(
108+
(selection, selectionIndex) => {
109+
// check if a decision point with these properties exists
110+
const selectedDecisionPnt = decisionPointMap.get(
111+
decisionPointHash(
112+
selection.name,
113+
selection.namespace,
114+
selection.version
115+
)
116+
)
112117

113-
if (!selectedDecisionPnt) {
114-
ctx.isValid = false
115-
ctx.errors.push({
116-
instancePath: `/vulnerabilities/${vulnerabilityIndex}/metrics/${metricIndex}/content/ssvc_v1/selections/${selectionIndex}`,
117-
message: `there exists no decision point with name ${select.name} and version ${select.version} in the namespace ${select.namespace}`,
118-
})
119-
} else {
120-
if (
121-
select.values &&
122-
!areValuesValidAndinOrder(selectedDecisionPnt.values, select.values)
123-
) {
118+
if (!selectedDecisionPnt) {
124119
ctx.isValid = false
125120
ctx.errors.push({
126121
instancePath: `/vulnerabilities/${vulnerabilityIndex}/metrics/${metricIndex}/content/ssvc_v1/selections/${selectionIndex}`,
127-
message: `this decision point contains invalid values or its values are not in order`,
122+
message: `there exists no decision point with name ${selection.name} and version ${selection.version} in the namespace ${selection.namespace}`,
128123
})
124+
} else {
125+
if (
126+
selection.values &&
127+
!areValuesValidAndinOrder(
128+
selectedDecisionPnt.values,
129+
selection.values
130+
)
131+
) {
132+
ctx.isValid = false
133+
ctx.errors.push({
134+
instancePath: `/vulnerabilities/${vulnerabilityIndex}/metrics/${metricIndex}/content/ssvc_v1/selections/${selectionIndex}`,
135+
message: `this decision point contains invalid values or its values are not in order`,
136+
})
137+
}
129138
}
130139
}
131-
})
140+
)
132141
})
133142
})
134143

0 commit comments

Comments
 (0)