From acb8cbb733924b33a157db07fe91d1d35ff38ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Mon, 29 Apr 2024 17:35:33 +0000 Subject: [PATCH] Use detected_license_expression_spdx consistently --- providers/summary/scancode-new.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/providers/summary/scancode-new.js b/providers/summary/scancode-new.js index 0658eff12..cc0106a41 100644 --- a/providers/summary/scancode-new.js +++ b/providers/summary/scancode-new.js @@ -120,13 +120,8 @@ class ScanCodeSummarizerNew { _getLicensesFromLicenseDetections(files) { const fullLicenses = files - .filter(file => file.percentage_of_license_text >= 90 && file.license_detections) - .reduce((licenses, file) => { - file.license_detections.forEach(licenseDetection => { - licenses.add(normalizeLicenseExpression(licenseDetection.license_expression, this.logger)) - }) - return licenses - }, new Set()) + .filter(file => file.percentage_of_license_text >= 90 && file.detected_license_expression_spdx) + .map(file => file.detected_license_expression_spdx) return joinExpressions(fullLicenses) } @@ -158,9 +153,7 @@ class ScanCodeSummarizerNew { const result = { path: file.path } const licenseExpression = - file.detected_license_expression_spdx || - normalizeLicenseExpression(file.detected_license_expression, this.logger) || - this._getLicenseByFileName([file], coordinates, 80) + file.detected_license_expression_spdx || this._getLicenseByFileName([file], coordinates, 80) setIfValue(result, 'license', licenseExpression) if (this._getLicensesFromLicenseDetections([file]) || this._getLicenseByFileName([file], coordinates)) {