Skip to content

Commit

Permalink
🚨 Address linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
superbuggy committed Oct 23, 2024
1 parent af98415 commit 572df4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cvss40.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Vector {
// Construct the vector string dynamically based on the current state of `metrics`
const baseString = "CVSS:4.0";
const metricEntries = Object.entries(this.metrics)
.filter(([key, value]) => value !== "X") // Filter out metrics with value "X"
.filter(([, value]) => value !== "X") // Filter out metrics with value "X"
.map(([key, value]) => `/${key}:${value}`)
.join('');
return baseString + metricEntries;
Expand Down Expand Up @@ -408,7 +408,7 @@ class Vector {
if (metrics.length > Object.keys(metricsLookup).length) {
throw new Error(`Invalid CVSS v4.0 vector: Duplicated metric types in \`${vector}\``);
}

const definedMetrics = Vector.ALL_METRICS;

if (metrics.length > Object.keys(definedMetrics).length) {
Expand All @@ -418,7 +418,7 @@ class Vector {

for (let [metricType, metricValue] of metricsEntries) {

if ( !(metricType in Vector.ALL_METRICS) ) {
if (!(metricType in Vector.ALL_METRICS)) {
throw new Error(`Invalid CVSS v4.0 vector: Unknown metric \`${metricType}\` in \`${vector}\``);
}

Expand Down Expand Up @@ -1098,7 +1098,7 @@ class CVSS40 {
const current_severity_distance_eq2 = distances["AC"] + distances["AT"];
const current_severity_distance_eq3eq6 = distances["VC"] + distances["VI"] + distances["VA"] + distances["CR"] + distances["IR"] + distances["AR"];
const current_severity_distance_eq4 = distances["SC"] + distances["SI"] + distances["SA"];
const current_severity_distance_eq5 = 0; // EQ5 is always 0 in this context
// const current_severity_distance_eq5 = 0; // EQ5 is always 0 in this context


// if the next lower macro score do not exist the result is Nan
Expand Down

0 comments on commit 572df4c

Please sign in to comment.