saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function info has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def info(name):
    '''
    Get information about a service on the system

    Args:
Severity: Minor
Found in salt/modules/win_service.py - About 1 hr to fix

    Function info has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def info(name, location='\\'):
        r'''
        Get the details about a task in the task scheduler.
    
        Args:
    Severity: Minor
    Found in salt/modules/win_task.py - About 1 hr to fix

      Function sls has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def sls(mods, test=None, exclude=None, queue=False, sync_mods=None, **kwargs):
          '''
          Execute the states in one or more SLS files
      
          test
      Severity: Minor
      Found in salt/modules/state.py - About 1 hr to fix

        Function stats has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def stats(path, hash_type='sha256', follow_symlinks=True):
            '''
            Return a dict containing the stats about a given file
        
            Under Windows, `gid` will equal `uid` and `group` will equal `user`.
        Severity: Minor
        Found in salt/modules/win_file.py - About 1 hr to fix

          Function install has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def install(name=None,
                      refresh=False,
                      fromrepo=None,
                      pkgs=None,
                      sources=None,
          Severity: Minor
          Found in salt/modules/zypperpkg.py - About 1 hr to fix

            Function catalog_register has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def catalog_register(consul_url=None, token=None, **kwargs):
                '''
                Registers a new node, service, or check
            
                :param consul_url: The Consul server URL.
            Severity: Minor
            Found in salt/modules/consul.py - About 1 hr to fix

              Function _expand_balancer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def _expand_balancer(lb):
                  '''
                  Convert the libcloud load-balancer object into something more serializable.
                  '''
                  ret = {}
              Severity: Minor
              Found in salt/cloud/clouds/gce.py - About 1 hr to fix

                Function gen_modules has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def gen_modules(self, initial_load=False):
                        '''
                        Tell the minion to reload the execution modules
                
                        CLI Example:
                Severity: Minor
                Found in salt/minion.py - About 1 hr to fix

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

                      def run(self):
                          try:
                              lines = self.parse_lit(self.parse_file(self.arguments[0]))
                          except IOError as exc:
                              document = self.state.document
                  Severity: Minor
                  Found in doc/_ext/saltdomain.py - About 1 hr 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 connect_callback has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def connect_callback(self, result):
                          if self._closing:
                              return
                          # Force re-auth on reconnect since the master
                          # may have been restarted
                  Severity: Minor
                  Found in salt/transport/tcp.py - About 1 hr 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 close has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def close(self):
                          if self._socket is not None:
                              try:
                                  self._socket.shutdown(socket.SHUT_RDWR)
                              except socket.error as exc:
                  Severity: Minor
                  Found in salt/transport/tcp.py - About 1 hr 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 get_chunks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_chunks(self, exclude=None, whitelist=None):
                          '''
                          Compile the top file and return the lowstate for the thorium runtime
                          to iterate over
                          '''
                  Severity: Minor
                  Found in salt/thorium/__init__.py - About 1 hr 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 call_runtime has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def call_runtime(self):
                          '''
                          Execute the runtime
                          '''
                          cache = self.gather_cache()
                  Severity: Minor
                  Found in salt/thorium/__init__.py - About 1 hr 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 _parse_op has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _parse_op(op):
                      '''
                      >>> _parse_op('>')
                      'gt'
                      >>> _parse_op('>=')
                  Severity: Minor
                  Found in setup.py - About 1 hr 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_socket has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def clear_socket(self):
                          '''
                          delete socket if you have it
                          '''
                          if hasattr(self, '_socket'):
                  Severity: Minor
                  Found in salt/payload.py - About 1 hr 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 set_ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def set_(name, add, match):
                      '''
                      Add a value to the named set
                  
                      USAGE:
                  Severity: Minor
                  Found in salt/thorium/reg.py - About 1 hr 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 access_keys has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def access_keys(opts):
                      '''
                      A key needs to be placed in the filesystem with permissions 0400 so
                      clients are required to run as root.
                      '''
                  Severity: Minor
                  Found in salt/daemons/masterapi.py - About 1 hr 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 update_fileserver has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_fileserver(self, interval, backends):
                          '''
                          Threading target which handles all updates for a given wait interval
                          '''
                          def _do_update():
                  Severity: Minor
                  Found in salt/master.py - About 1 hr 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 authenticate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def authenticate(username, password):
                      '''
                      Returns True if the given username and password authenticate for the
                      given service.  Returns False otherwise
                  
                  
                  Severity: Minor
                  Found in salt/auth/pam.py - About 1 hr 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 targets has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def targets(self):
                          '''
                          Return ip addrs based on netmask, sitting in the "glob" spot because
                          it is the default
                          '''
                  Severity: Minor
                  Found in salt/roster/scan.py - About 1 hr 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