saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Avoid deeply nested control flow statements.
Open

                    if ( copyIsArray ) {
                        copyIsArray = false;
                        clone = src && jQuery.isArray(src) ? src : [];

                    } else {
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if reqfile in _requirements_files:
                            continue
                        _requirements_files.append(reqfile)
    Severity: Major
    Found in noxfile.py - About 45 mins to fix

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

          def handle_stream(self, stream, address):
              '''
              Handle incoming streams and add messages to the incoming queue
              '''
              log.trace('Req client %s connected', address)
      Severity: Minor
      Found in salt/transport/tcp.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

      Avoid deeply nested control flow statements.
      Open

                          if tcp_keepalive_idle > 0:
                              sock.setsockopt(
                                  socket.SOL_TCP, socket.TCP_KEEPIDLE,
                                  int(tcp_keepalive_idle))
                      if hasattr(socket, 'TCP_KEEPCNT'):
      Severity: Major
      Found in salt/transport/tcp.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( name in thisCache ) {
                                name = [ name ];
                            } else {
                                name = name.split(" ");
                            }
        Severity: Major
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if ( cache[1] === true ) {
                                          return true;
                                      }
          Severity: Major
          Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

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

                    def finalize_options(self):
                        develop.finalize_options(self)
                        if 'WRITE_SALT_VERSION' in os.environ:
                            self.write_salt_version = True
                        if 'GENERATE_SALT_SYSPATHS' in os.environ:
            Severity: Minor
            Found in setup.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

            Avoid deeply nested control flow statements.
            Open

                                if tcp_keepalive_idle <= 0:
                                    tcp_keepalive_idle = 7200
                                if tcp_keepalive_intvl <= 0:
            Severity: Major
            Found in salt/transport/tcp.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if self.opts.get('auth_events') is True:
                                          self.event.fire_event(eload, salt.utils.event.tagify(prefix='auth'))
                                      return {'enc': 'clear',
              Severity: Major
              Found in salt/transport/mixins/auth.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
                                            cur = cur.replace( " " + clazz + " ", " " );
                                        }
                Severity: Major
                Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for ( type in data.events ) {
                                              if ( special[ type ] ) {
                                                  jQuery.event.remove( elem, type );
                  
                                              // This is a shortcut to avoid jQuery.event.remove's overhead
                  Severity: Major
                  Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                        if ( !status && s.isLocal && !s.crossDomain ) {
                                                            status = responses.text ? 200 : 404;
                                                        // IE - #1450: sometimes returns 1223 when it should be 204
                                                        } else if ( status === 1223 ) {
                                                            status = 204;
                    Severity: Major
                    Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

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

                          def __init__(self, io_loop, future, timeout):
                              super(FutureWithTimeout, self).__init__()
                              self.io_loop = io_loop
                              self._future = future
                              if timeout is not None:
                      Severity: Minor
                      Found in salt/transport/ipc.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 _decode_messages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _decode_messages(self, messages):
                              '''
                              Take the zmq messages, decrypt/decode them into a payload
                      
                              :param list messages: A list of messages to be decoded
                      Severity: Minor
                      Found in salt/transport/zeromq.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

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( !name.indexOf( "data-" ) ) {
                                                  name = jQuery.camelCase( name.slice(5) );
                      
                                                  dataAttr( elem, name, data[ name ] );
                                              }
                      Severity: Major
                      Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                            if ( xhr.readyState !== 4 ) {
                                                                xhr.abort();
                                                            }
                        Severity: Major
                        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if ( !xhrCallbacks ) {
                                                          xhrCallbacks = {};
                                                          jQuery( window ).unload( xhrOnUnloadAbort );
                                                      }
                          Severity: Major
                          Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        with open(fdest, 'wb') as wfh:
                                                            if IS_PY3:
                                                                while True:
                                                                    chunk = req.read(4096)
                                                                    if len(chunk) == 0:
                            Severity: Major
                            Found in setup.py - About 45 mins to fix

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

                                  def _post_fork_init(self):
                                      '''
                                      Some things need to be init'd after the fork has completed
                                      The easiest example is that one of these module types creates a thread
                                      in the parent process, then once the fork happens you'll start getting
                              Severity: Minor
                              Found in salt/master.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

                              Avoid deeply nested control flow statements.
                              Open

                                                  if a.minion_or_fn_matcher in six.iterkeys(d):
                                                      auth_dict[a.user_fk.username][a.minion_or_fn_matcher].append(a.minion_fn)
                                                      found = True
                                          if not found:
                              Severity: Major
                              Found in salt/auth/django.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language