From 821f51a700b75ce87f56e53700c538048bcbe272 Mon Sep 17 00:00:00 2001 From: qwertiko GmbH Date: Mon, 18 Oct 2021 16:34:36 +0200 Subject: [PATCH] result used before assignment result variable was used before assignment. Also fixed unnecessary code for len check of result since when it is not set in if call above we can directly return an empty list --- phishing/decode-spam-headers.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/phishing/decode-spam-headers.py b/phishing/decode-spam-headers.py index 0abf49e..ba06915 100644 --- a/phishing/decode-spam-headers.py +++ b/phishing/decode-spam-headers.py @@ -1660,15 +1660,12 @@ Results will be unsound. Make sure you have pasted your headers with correct spa if value.strip().lower() == 'yes': result = self.logger.colored(f'- SpamAssassin marked this message as SPAM:\n', 'red') result += f'\t- ' + self.logger.colored(value, 'red') + '\n' - - if len(result) == 0: - return [] - - return { - 'header' : header, - 'value': value, - 'analysis' : result - } + return { + 'header' : header, + 'value': value, + 'analysis' : result + } + return [] def testSpamAssassinSpamLevel(self): (num, header, value) = self.getHeader('X-Spam-Level')