Showing 64 of 176 total issues
Function check_devices
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_devices(self):
devs = os.listdir('/dev/')
hds = []
print("Searching hd devices...")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if len(mountpoint) != 0:
print(" Found: " + j[0] + " -> /dev/" + j[1] + " -> " + j[2] + " -> " + uuid_sup + ' -> ' + mountpoint)
self.exslin = True
tablemount.append([j[0], j[1], j[2], mountpoint])
Avoid deeply nested control flow statements. Open
Open
if os.path.exists("/mnt/RCSPE/files/LINUX/") == False:
self.stalin = False
self.liclin = False
print(" Not found: Linux license")
Avoid deeply nested control flow statements. Open
Open
if svalue == True:
self.crylin = True
Avoid deeply nested control flow statements. Open
Open
if ret != 0:
uuid_sup = "UUID"
uuid = subprocess.check_output("blkid | grep -i '{}' | awk '{{print $2}}'".format(j[1]), shell=True)[6:-2].decode('utf-8')
mountpoint = subprocess.check_output("cat /mnt/etc/fstab 2> /dev/null | grep -v '#' | grep -i {} | egrep ' / | /home | /var ' | awk '{{print $2}}'".format(uuid), shell=True)[:-1].decode('utf-8')
Avoid deeply nested control flow statements. Open
Open
if subprocess.check_output("ls -l /mnt2/ | grep '{}' | grep -i '^d' | wc -l".format(line[0]), shell=True).decode('utf-8')[:-1] == '0':
break
Consider simplifying this complex logical expression. Open
Open
if is_dir == False and is_temp_dir == False:
print(" " + i['username'] + " status is: not infected")
i['status'] = None
elif is_temp_file1 == True and is_temp_file2 == True and is_dir == False:
print(" " + i['username'] + " status is: infected")
Consider simplifying this complex logical expression. Open
Open
if osversion.find("10.5") != -1 or osversion.find("10.6") != -1 or osversion.find("10.7") != -1 or osversion.find("10.8") != -1 or osversion.find("10.9") != -1 or osversion.find("10.10") != -1:
ossupport = True
Consider simplifying this complex logical expression. Open
Open
if i[0] == 'linux' and i[3] == '/':
tablelinux.update({'rootdisk': i[1]})
tablelinux.update({'rootfs': i[2]})
tablelinux.update({'rootmount': i[3]})
elif i[0] == 'linux' and i[3] == ('/home' or '/home/'):
Function check_ossystems
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_ossystems(self):
tablemount = self.check_mount()
tableosx = {}
tablelinux = {}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
Open
return [False, False]
Avoid too many return
statements within this function. Open
Open
return [True, False]
Avoid too many return
statements within this function. Open
Open
return True
Avoid too many return
statements within this function. Open
Open
return False
Avoid too many return
statements within this function. Open
Open
return True
Avoid too many return
statements within this function. Open
Open
return False
Avoid too many return
statements within this function. Open
Open
return True
Avoid too many return
statements within this function. Open
Open
return True
Avoid too many return
statements within this function. Open
Open
return False
Avoid too many return
statements within this function. Open
Open
return False