saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Avoid too many return statements within this function.
Open

    return fnd
Severity: Major
Found in salt/fileserver/roots.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return ''
    Severity: Major
    Found in salt/crypt.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return self.extract_aes(payload)
      Severity: Major
      Found in salt/crypt.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return []
        Severity: Major
        Found in salt/fileserver/roots.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return key_str, token
          Severity: Major
          Found in salt/crypt.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return self.extract_aes(payload, master_pub=False)
            Severity: Major
            Found in salt/crypt.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return False
              Severity: Major
              Found in salt/fileserver/__init__.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return fnd
                Severity: Major
                Found in salt/fileserver/roots.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return fnd
                  Severity: Major
                  Found in salt/fileserver/minionfs.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return self.extract_aes(payload, master_pub=False)
                    Severity: Major
                    Found in salt/crypt.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return _add_file_stat(fnd)
                      Severity: Major
                      Found in salt/fileserver/roots.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return []
                        Severity: Major
                        Found in salt/fileserver/svnfs.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return ret
                          Severity: Major
                          Found in salt/fileserver/minionfs.py - About 30 mins to fix

                            Function _encrypt_private has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _encrypt_private(self, ret, dictkey, target):
                                    '''
                                    The server equivalent of ReqChannel.crypted_transfer_decode_dictentry
                                    '''
                                    # encrypt with a specific AES key
                            Severity: Minor
                            Found in salt/transport/mixins/auth.py - About 25 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 clear_doc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def clear_doc(self, docname):
                                    for typ, routes in self.routes.items():
                                        for path, info in list(routes.items()):
                                            if info[0] == docname:
                                                del routes[path]
                            Severity: Minor
                            Found in doc/_ext/httpdomain.py - About 25 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 start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def start(self):
                                    '''
                                    Perform the work necessary to start up a Tornado IPC server
                            
                                    Blocks until socket is established
                            Severity: Minor
                            Found in salt/transport/ipc.py - About 25 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 on_recv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def on_recv(self, callback):
                                    '''
                                    Register an on_recv callback
                                    '''
                                    if callback is None:
                            Severity: Minor
                            Found in salt/transport/tcp.py - About 25 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 _publish_daemon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _publish_daemon(self, **kwargs):
                                    '''
                                    Bind to the interface specified in the configuration file
                                    '''
                                    salt.utils.process.appendproctitle(self.__class__.__name__)
                            Severity: Minor
                            Found in salt/transport/tcp.py - About 25 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 event_map has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def event_map(self):
                                    if ZeroMQSocketMonitor.__EVENT_MAP is None:
                                        event_map = {}
                                        for name in dir(zmq):
                                            if name.startswith('EVENT_'):
                            Severity: Minor
                            Found in salt/transport/zeromq.py - About 25 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 factory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def factory(opts, **kwargs):
                                    # Default to ZeroMQ for now
                                    ttype = 'zeromq'
                            
                                    # determine the ttype
                            Severity: Minor
                            Found in salt/transport/server.py - About 25 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

                            Severity
                            Category
                            Status
                            Source
                            Language