From 09c2e7b2d59b10ddf0d6ab20ead2c40ee52a4250 Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Wed, 5 Apr 2017 04:27:39 +0300 Subject: [PATCH] Fix SonarQube python:S1871. --- ssh-audit.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index e1684f7..9fcd04c 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -1192,11 +1192,9 @@ class SSH(object): # pylint: disable=too-few-public-methods if ssh_prefix not in result: result[ssh_prefix] = [None, None, None] prev, push = result[ssh_prefix][i], False - if prev is None: - push = True - elif i == 0 and prev < ssh_version: - push = True - elif i > 0 and prev > ssh_version: + if ((prev is None) or + (prev < ssh_version and i == 0) or + (prev > ssh_version and i > 0)): push = True if push: result[ssh_prefix][i] = ssh_version