GoVanguard/legion

View on GitHub

Showing 128 of 209 total issues

Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):

        while self.processing == True:
            self.sleep(1)  # effectively a semaphore

Severity: Minor
Found in app/Screenshooter.py - About 45 mins to fix

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 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, name='', product='', version='', extrainfo='', fingerprint='', cpe=''):
Severity: Minor
Found in db/entities/app.py - About 45 mins to fix

Function restoreToolTabs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def restoreToolTabs(self):
        # false means we are fetching processes with display flag=False, which is the case for every process once
        # a project is closed.
        tools = self.controller.getProcessesFromDB(self.viewState.filters, showProcesses=False)
        nbr = len(tools)  # show a progress bar because this could take long
Severity: Minor
Found in ui/view.py - About 45 mins to fix

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]:
Severity: Minor
Found in ui/dialogs.py - About 45 mins to fix

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 addHosts has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def addHosts(self, targetHosts, runHostDiscovery, runStagedNmap, nmapSpeed, scanMode, nmapOptions = []):
Severity: Minor
Found in controller/controller.py - About 45 mins to fix

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, user: str, passw: str, db: str, host='localhost', port=5432):
Severity: Minor
Found in db/postgresDbAdapter.py - About 35 mins to fix

Function establishSqliteConnection has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def establishSqliteConnection(self, user: str, passw: str, db: str, host='localhost', port=5432):
Severity: Minor
Found in db/postgresDbAdapter.py - About 35 mins to fix

Function createNewTabForHost has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def createNewTabForHost(self, ip, tabTitle, restoring=False, content='', filename=''):
Severity: Minor
Found in ui/view.py - About 35 mins to fix

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, portId, protocol, state, host, service=''):
Severity: Minor
Found in db/entities/port.py - About 35 mins to fix

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, ip, port, service, settings, parent=None):
Severity: Minor
Found in ui/dialogs.py - About 35 mins to fix

Function checkProcessQueue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def checkProcessQueue(self):
        log.debug('# MAX PROCESSES: ' + str(self.settings.general_max_fast_processes))
        log.debug('# Fast processes running: ' + str(self.fastProcessesRunning))
        log.debug('# Fast processes queued: ' + str(self.fastProcessQueue.qsize()))

Severity: Minor
Found in controller/controller.py - About 35 mins to fix

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 addHosts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def addHosts(self, targetHosts, runHostDiscovery, runStagedNmap, nmapSpeed, scanMode, nmapOptions = []):
        if targetHosts == '':
            log.info('No hosts entered..')
            return

Severity: Minor
Found in controller/controller.py - About 35 mins to fix

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 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(","):
Severity: Minor
Found in controller/controller.py - About 35 mins to fix

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
Severity: Minor
Found in ui/settingsDialog.py - About 35 mins to fix

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:
Severity: Minor
Found in ui/models/scriptmodels.py - About 35 mins to fix

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=''):
        '''get a list of Host object'''
        if (status == ''):
            return self.__hosts.values()

Severity: Minor
Found in parsers/Parser.py - About 35 mins to fix

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/vmware-big.jpg")
Severity: Major
Found in ui/models/hostmodels.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return QtGui.QIcon("./images/question-icon.png")
Severity: Major
Found in ui/models/hostmodels.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return value
Severity: Major
Found in ui/models/hostmodels.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return QtGui.QIcon("./images/hp-icon.png")
Severity: Major
Found in ui/models/hostmodels.py - About 30 mins to fix
Severity
Category
Status
Source
Language