From e6ddeedcbabb283780aa7b575cde962255935216 Mon Sep 17 00:00:00 2001 From: Robin Quintero Date: Thu, 21 Mar 2024 16:44:29 -0500 Subject: [PATCH] feat(cli): #37 no files found - Add a message when no files are found with complexity greater than the max complexity --- complexipy/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/complexipy/utils.py b/complexipy/utils.py index 254f773..7c19af3 100644 --- a/complexipy/utils.py +++ b/complexipy/utils.py @@ -32,7 +32,11 @@ def output_summary( table, has_success, total_complexity = create_table_function_level( files, max_complexity, details, sort ) - console.print(Align.center(table)) + + if details == DetailTypes.low and table.row_count < 1: + console.print(f"No {'file' if file_level else 'function'}{'s' if len(files) > 1 else ''} were found with complexity greater than {max_complexity}.") + else: + console.print(Align.center(table)) console.print(f":brain: Total Cognitive Complexity in {path}: {total_complexity}") return has_success