Skip to content

Commit 844749d

Browse files
committed
fix lint issues
1 parent d98ad25 commit 844749d

File tree

4 files changed

+214
-218
lines changed

4 files changed

+214
-218
lines changed

commands/report.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,56 +139,56 @@ async function report (argv, _dir) {
139139
const isNested = pkgName === nestedPkgName && pkgVersion === nestedPkgVersion
140140

141141
// Processing packages from NCM service
142-
let includedCount = 0;
143-
let skippedCount = 0;
144-
142+
// let includedCount = 0
143+
// let skippedCount = 0
144+
145145
for (const { name, version, scores, published } of data) {
146-
let maxSeverity = 0;
147-
let license = {};
148-
const failures = [];
146+
let maxSeverity = 0
147+
let license = {}
148+
const failures = []
149149

150150
for (const score of scores) {
151-
const severityValue = SEVERITY_RMAP.indexOf(score.severity);
151+
const severityValue = SEVERITY_RMAP.indexOf(score.severity)
152152

153153
if (score.group !== 'compliance' &&
154154
score.group !== 'security' &&
155155
score.group !== 'risk') {
156-
continue;
156+
continue
157157
}
158158

159159
if (severityValue > maxSeverity) {
160-
maxSeverity = severityValue;
160+
maxSeverity = severityValue
161161
}
162162

163163
if (score.pass === false) {
164-
failures.push(score);
165-
hasFailures = true;
164+
failures.push(score)
165+
hasFailures = true
166166
}
167167

168168
if (score.name === 'license') {
169-
license = score;
169+
license = score
170170
}
171171
}
172172

173173
// Modified approach to include ALL packages in the report
174174
// Even packages with null/undefined versions will be included with a default version
175-
let effectiveVersion = version;
175+
let effectiveVersion = version
176176
if (effectiveVersion === null || effectiveVersion === undefined) {
177-
effectiveVersion = '0.0.0';
177+
effectiveVersion = '0.0.0'
178178
// Using default version 0.0.0 for package
179179
}
180-
180+
181181
// Skip nested packages with severity issues
182182
if (isNested && !!maxSeverity) {
183-
skippedCount++;
183+
// skippedCount++
184184
// Skipping nested package
185-
continue;
185+
continue
186186
}
187-
187+
188188
// Check if license has failed, which should upgrade to critical severity
189-
const getLicenseScore = ({ pass }) => pass === false ? 0 : null;
189+
// const getLicenseScore = ({ pass }) => pass === false ? 0 : null
190190
if (license && license.pass === false) {
191-
maxSeverity = 4;
191+
maxSeverity = 4
192192
}
193193

194194
// Add the package to our report
@@ -200,19 +200,19 @@ async function report (argv, _dir) {
200200
failures,
201201
license,
202202
scores
203-
});
204-
205-
includedCount++;
203+
})
204+
205+
// includedCount++
206206
}
207-
207+
208208
// Package processing complete
209209

210210
pkgScores = moduleSort(pkgScores)
211211

212212
// Process whitelisted packages
213213
const whitelisted = pkgScores.filter(pkg => whitelist.has(`${pkg.name}@${pkg.version}`))
214214
.map(pkgScore => ({ ...pkgScore, quantitativeScore: score(pkgScore.scores, pkgScore.maxSeverity) }))
215-
215+
216216
// Filter out whitelisted packages from the main package list
217217
pkgScores = pkgScores.filter(pkg => !whitelist.has(`${pkg.name}@${pkg.version}`))
218218
.map(pkgScore => ({ ...pkgScore, quantitativeScore: score(pkgScore.scores, pkgScore.maxSeverity) }))

0 commit comments

Comments
 (0)