Showing 130 of 217 total issues
Avoid too many return
statements within this function. Open
return QtGui.QIcon("./images/hp-icon.png")
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return checkedFont
Avoid too many return
statements within this function. Open
return QtGui.QIcon("./images/vmware-big.jpg")
Function contextMenuProcessesTableView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def contextMenuProcessesTableView(self, pos):
if self.ui.ProcessesTableView.selectionModel() and self.ui.ProcessesTableView.selectionModel().selectedRows():
menu = self.controller.getContextMenuForProcess()
menu.aboutToShow.connect(self.setVisible)
- 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 backupAndSave
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def backupAndSave(self, newSettings, saveBackup=True):
# Backup and save
if saveBackup:
log.info('Backing up old settings and saving new settings...')
os.rename(os.path.expanduser('~/.local/share/legion/legion.conf'), os.path.expanduser("~/.local/share/legion/backup/") + getTimestamp() + '-legion.conf')
- 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 getTempFolder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getTempFolder():
if isWsl():
tempPathWin = "{0}\\legion\\tmp".format(getAppdataTemp())
tempPath = winPath2Unix(tempPathWin)
if not os.path.isdir(os.path.expanduser(tempPath)):
- 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 updateSettings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def updateSettings(self):
# LEO: reorganised stuff in a more logical way but no changes were made yet :)
# update GENERAL tab settings
self.settings.general_default_terminal = str(self.terminalComboBox.currentText())
self.settings.general_max_fast_processes = str(self.fastProcessesComboBox.currentText())
- 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 getCves
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getCves(self):
cveOutput = self.output
cveObjects = []
if len(cveOutput) > 0:
- 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 validateUniqueToolName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validateUniqueToolName(self, widget, tablerow, text):
if tablerow != -1:
for row in [i for i in range(widget.rowCount()) if i not in [tablerow]]:
if widget.item(row,0).text() == text:
return 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"