From 92de6c688928d5c539f8647a06406c48105dcea8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:04:09 +0100 Subject: [PATCH] Simplify only-findings codebase.walk #685 #357 Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_only_findings.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index ffe3e127fe8..567eb8d725e 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -54,8 +54,7 @@ def process_codebase(self, codebase, **kwargs): not have findings e.g. if they have no scan data (excluding info) and no errors. """ - resources = codebase.walk(topdown=True, skip_filtered=True) - for resource in resources: + for resource in codebase.walk(): if not has_findings(resource): resource.is_filtered = True @@ -64,4 +63,4 @@ def has_findings(resource): """ Return True if this resource has findings. """ - return bool(resource.errors or resource.get_scans().values()) + return bool(resource.errors or any(resource.get_scans().values()))