From f20af247c044b632d13ae8978e9d042b8d6accb1 Mon Sep 17 00:00:00 2001 From: John Speed Meyers Date: Fri, 6 Sep 2024 14:40:38 -0400 Subject: [PATCH] Make get_components_without_identifiers() more concise --- ntia_conformance_checker/sbom_checker.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ntia_conformance_checker/sbom_checker.py b/ntia_conformance_checker/sbom_checker.py index d07ad95..a3f2daa 100644 --- a/ntia_conformance_checker/sbom_checker.py +++ b/ntia_conformance_checker/sbom_checker.py @@ -116,11 +116,7 @@ def get_components_without_suppliers(self, return_tuples=False): def get_components_without_identifiers(self): """Retrieve name of components without identifiers.""" - components_without_identifiers = [] - for package in self.doc.packages: - if not package.spdx_id: - components_without_identifiers.append(package.name) - return components_without_identifiers + return [package.name for package in self.doc.packages if not package.spdx_id] def check_ntia_minimum_elements_compliance(self): """Check overall compliance with NTIA minimum elements."""