Showing 64 of 176 total issues
Function check_osx_config
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def check_osx_config(self):
osproduct = "Mac OS X"
osversion = ""
oscode = ""
osname = ""
- 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
Function uninstall
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def uninstall(self, *args):
print("Uninstall action...")
model, rows = self.builder.get_object("treeview-selection1").get_selected_rows()
- 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
Function load_systems
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def load_systems(self):
self.builder.get_object("comboboxtext1").remove_all()
self.builder.get_object("liststore1").clear()
self.builder.get_object("comboboxtext1").set_sensitive(False)
self.builder.get_object("treeview1").set_sensitive(False)
- 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
Function install
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def install(self, *args):
print("Install action...")
model, rows = self.builder.get_object("treeview-selection1").get_selected_rows()
- 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
Function install_linux_backdoor
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_linux_backdoor(self, user):
print(" Try to install the backdoor for " + user + " on Linux system...")
try:
ret = subprocess.check_output("mount -t {} /dev/{} /mnt/ 2> /dev/null".format(self.tablin['rootfs'], self.tablin['rootdisk']), shell=True)
Function check_linux_system
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def check_linux_system(self, tablemount):
tablelinux = {}
print(" Check Linux system on mount points...")
- 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
Function umount_devs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def umount_devs(self):
print("Check drives on partitions to umount...")
if self.destdevs == []:
print("Drives on partitions not found")
- 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
Function scramble_name
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def scramble_name(self, string, scramble, crypt):
ALPHABET_LEN = 64
alphabet = ['_', 'B', 'q', 'w', 'H', 'a', 'F', '8', 'T', 'k', 'K', 'D', 'M',
'f', 'O', 'z', 'Q', 'A', 'S', 'x', '4', 'V', 'u', 'X', 'd', 'Z',
- 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
Function export_linux_logs
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def export_linux_logs(self, user):
print(" Try to export logs for " + user + " on Linux system...")
[hex_high_dt, hex_low_dt] = self.ts_unix2win()
Function check_osconfigs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_osconfigs(self):
if self.check_ossystems() == False:
return [False, False]
print("Check OS systems configuration...")
- 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
Function export_osx_logs
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def export_osx_logs(self, user):
print(" Try to export logs for " + user + " on Mac OS X system...")
[hex_high_dt, hex_low_dt] = self.ts_unix2win()
Function install_osx_backdoor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_osx_backdoor(self, user):
print(" Try to install the backdoor for " + user + " on Mac OS X system...")
try:
ret = subprocess.check_output("mount -t {} -o force /dev/{} /mnt/ 2> /dev/null".format(self.tabosx['rootfsrw'], self.tabosx['rootdisk']), shell=True)
Function check_osx_config
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_osx_config(self):
osproduct = "Mac OS X"
osversion = ""
oscode = ""
osname = ""
Function check_linux_config
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_linux_config(self):
osproduct = "Linux"
osversion = ""
oscode = ""
osname = ""
Avoid deeply nested control flow statements. Open
if os.path.exists("/mnt/RCSPE/files/OSX/") == False:
self.staosx = False
self.licosx = False
print(" Not found: OS X license")
Avoid deeply nested control flow statements. Open
for line in open("/mnt/RCSPE/RCS.ini").readlines():
if line.find("[RCS]") != -1:
continue
line = line.replace("\n", "").split("=")
Avoid deeply nested control flow statements. Open
if len(j) > 3:
try:
ret = subprocess.call("cryptsetup isLuks /dev/{}".format(j), shell=True)
if int(ret) == 0:
if svalue == True:
Avoid deeply nested control flow statements. Open
if subprocess.check_output("ls -l /mnt/home/ | grep '{}' | grep -i '^d' | wc -l".format(line[0]), shell=True).decode('utf-8')[:-1] == '0':
break
else:
Avoid deeply nested control flow statements. Open
for i in keys:
if (i in self.backconf) == False:
print(" Not found: " + i + " in configuration file")
self.backconf = None
break
Avoid deeply nested control flow statements. Open
if self.backconf != None:
if ('holddir' in self.backconf) == True:
self.backconf.update({'holddir': self.backconf['hdir']})
if ('holdreg' in self.backconf) == True: