saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Avoid deeply nested control flow statements.
Open

                        with salt.utils.files.fopen(pubfn_denied, 'w+') as fp_:
                            fp_.write(load['pub'])
                        eload = {'result': False,
Severity: Major
Found in salt/transport/mixins/auth.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( (event.result = ret) === false ) {
                                event.preventDefault();
                                event.stopPropagation();
                            }
    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 ( elem && elem.parentNode ) {
                              // Handle the case where IE, Opera, and Webkit return items
                              // by name instead of ID
                              if ( elem.id === m ) {
                                  results.push( elem );
      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 ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                return false;
                                            }
        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 ( xhrOnUnloadAbort ) {
                                                  delete xhrCallbacks[ handle ];
                                              }
          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 tcp_keepalive_intvl > 0:
                                    sock.setsockopt(
                                        socket.SOL_TCP, socket.TCP_KEEPINTVL,
                                        int(tcp_keepalive_intvl))
                        if hasattr(socket, 'SIO_KEEPALIVE_VALS'):
            Severity: Major
            Found in salt/transport/tcp.py - About 45 mins to fix

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

                  def _internal_send_recv(self):
                      while self.send_queue:
                          message = self.send_queue[0]
                          future = self.send_future_map.get(message, None)
                          if future is None:
              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

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

                  def hash_and_stat_file(self, path, saltenv='base'):
                      '''
                      The same as hash_file, but also return the file's mode, or None if no
                      mode data is present.
                      '''
              Severity: Minor
              Found in salt/fileclient.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 ( matches[ sel ] === undefined ) {
                                          matches[ sel ] = handleObj.needsContext ?
                                              jQuery( sel, this ).index( cur ) >= 0 :
                                              jQuery.find( sel, this, null, [ cur ] ).length;
                                      }
              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 line.startswith('pbr='):
                                        session.install(
                                            '--progress-bar=off',
                                            line.split()[0].strip(),
                                            silent=PIP_INSTALL_SILENT)
                Severity: Major
                Found in noxfile.py - About 45 mins to fix

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

                      def factory(cls, opts, **kwargs):
                          # Default to ZeroMQ for now
                          ttype = 'zeromq'
                  
                          # determine the ttype
                  Severity: Minor
                  Found in salt/transport/client.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 ( rscriptType.test( node.type || "" ) &&
                                              !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
                  
                                              if ( node.src ) {
                                                  // Hope ajax is available...
                  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 ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                                cur += 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

                                                  if ( !(unmatched[i] || setMatched[i]) ) {
                                                      setMatched[i] = pop.call( results );
                                                  }
                      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 stamp is True:
                                                item['time'] = event['data']['_stamp']
                                    __reg__[name]['val'].append(item)
                        Severity: Major
                        Found in salt/thorium/reg.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for ( match in context ) {
                                                      // Properties of context are called as methods if possible
                                                      if ( jQuery.isFunction( this[ match ] ) ) {
                                                          this[ match ]( context[ match ] );
                          
                          
                          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

                                            } else if ( copy !== undefined ) {
                                                target[ name ] = copy;
                                            }
                            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 ( (data = cache[1]) === true || data === cachedruns ) {
                                                              return data === true;
                                                          }
                              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 ( hasScripts ) {
                                                            jQuery.merge( scripts, getAll( node, "script" ) );
                                                        }
                                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 salt.utils.files.fopen(pubfn_denied, 'w+') as fp_:
                                                              fp_.write(load['pub'])
                                                          eload = {'result': False,
                                  Severity: Major
                                  Found in salt/transport/mixins/auth.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language