Showing 130 of 217 total issues
Avoid deeply nested control flow statements. Open
if len(tool) == 4:
servicesList = tool[3].split(',')
self.terminalServicesActiveTable.setRowCount(len(servicesList))
for i in range(len(servicesList)):
self.terminalServicesActiveTable.setItem(i, 0, QtWidgets.QTableWidgetItem())
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if tool[0] == a[1]:
tabTitle = a[1] + " (" + port + "/" + protocol + ")"
# Cheese
outputfile = self.logic.activeProject.properties.runningFolder + "/" + \
re.sub("[^0-9a-zA-Z]", "", str(tool[0])) + \
- Create a ticketCreate a ticket
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, viewState: ViewState, ui, ui_mainwindow, shell: Shell, app, loop):
- Create a ticketCreate a ticket
Function sortArrayWithArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sortArrayWithArray(array, arrayToSort):
for i in range(0, len(array) - 1):
swap_test = False
for j in range(0, len(array) - i - 1):
if array[j] > array[j + 1]:
- Read upRead up
- Create a ticketCreate a ticket
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 checkProcessQueue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def checkProcessQueue(self):
log.debug('Queue maximum concurrent processes: {0}'.format(str(self.settings.general_max_fast_processes)))
log.debug('Queue processes running: {0}'.format(str(self.fastProcessesRunning)))
log.debug('Queue processes waiting: {0}'.format(str(self.fastProcessQueue.qsize())))
- Read upRead up
- Create a ticketCreate a ticket
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 setCurrentFilters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setCurrentFilters(self, filters):
if not self.hostsUp.isChecked() == filters[0]:
self.hostsUp.toggle()
if not self.hostsDown.isChecked() == filters[1]:
- Read upRead up
- Create a ticketCreate a ticket
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 clearLayout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clearLayout(layout):
if layout != None:
while layout.count():
item = layout.takeAt(0)
widget = item.widget()
- Read upRead up
- Create a ticketCreate a ticket
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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, portId, protocol, state, host, service=''):
- Create a ticketCreate a ticket
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, user: str, passw: str, db: str, host='localhost', port=5432):
- Create a ticketCreate a ticket
Function createNewTabForHost
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createNewTabForHost(self, ip, tabTitle, restoring=False, content='', filename=''):
- Create a ticketCreate a ticket
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, ip, port, service, settings, parent=None):
- Create a ticketCreate a ticket
Function establishSqliteConnection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def establishSqliteConnection(self, user: str, passw: str, db: str, host='localhost', port=5432):
- Create a ticketCreate a ticket
Function runToolsFor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def runToolsFor(self, service, hostname, ip, port, protocol='tcp'):
- Create a ticketCreate a ticket
Function getContextMenuForServiceName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getContextMenuForServiceName(self, serviceName='*', menu=None):
if menu == None: # if no menu was given, create a new one
menu = QMenu()
if serviceName == '*' or serviceName in self.settings.general_web_services.split(","):
- Read upRead up
- Create a ticketCreate a ticket
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 selectGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def selectGroup(self):
tabSelected = -1
if self.ToolSettingsTab.tabText(self.ToolSettingsTab.currentIndex()) == 'Host Commands':
tabSelected = 1
- Read upRead up
- Create a ticketCreate a ticket
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 sort
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sort(self, Ncol, order):
self.layoutAboutToBeChanged.emit()
array=[]
if Ncol == 1:
- Read upRead up
- Create a ticketCreate a ticket
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 getAllHosts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getAllHosts(self, status=None):
'''get a list of Host object'''
if status is None:
return self.__hosts.values()
- Read upRead up
- Create a ticketCreate a ticket
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
return QtGui.QIcon("./images/question-icon.png")
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return value
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return QtGui.QIcon("./images/vmware-big.jpg")
- Create a ticketCreate a ticket