saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Consider simplifying this complex logical expression.
Open

                if ((clear_pillar and clear_grains) or
                    (clear_pillar and not minion_grains) or
                    (clear_grains and not minion_pillar)):
                    # Not saving pillar or grains, so just delete the cache file
                    self.cache.flush(bank, 'data')
Severity: Critical
Found in salt/utils/master.py - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (windows_installer or
                    (uninstall_string and
                        re.search(r'MsiExec.exe\s|MsiExec\s', uninstall_string, flags=re.IGNORECASE + re.UNICODE))):
                version_data.update({'win_installer_type': 'winmsi'})
            elif (re.match(r'InstallShield_', key_software, re.IGNORECASE) is not None or
    Severity: Critical
    Found in salt/utils/pkg/win.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if the_localname == 'textBox' \
                          or the_localname == 'comboBox':
                      label_items = result.xpath('.//*[local-name() = "label"]')
                      for label_item in label_items:
                          if label_item.text:
      Severity: Critical
      Found in salt/modules/win_lgpo.py - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                                                    if etree.QName(child_item).localname == 'boolean' \
                                                            and (TRUE_LIST_XPATH(child_item) or FALSE_LIST_XPATH(child_item)):
                                                        # WARNING: no OOB adm files use true/falseList items
                                                        # this has not been fully vetted
                                                        temp_dict = {'trueList': TRUE_LIST_XPATH, 'falseList': FALSE_LIST_XPATH}
        Severity: Critical
        Found in salt/modules/win_lgpo.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if isinstance(cur_cmp, dict) and isinstance(cur_struct, dict):
                  log.debug('Comparing dict to dict')
                  for cmp_key, cmp_value in six.iteritems(cur_cmp):
                      if cmp_key == '*':
                          # matches any key from the source dictionary
          Severity: Critical
          Found in salt/beacons/napalm_beacon.py - About 1 hr to fix

            Function route53_alias_present has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def route53_alias_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
                '''
                Ensure a Route53 Alias exists and is pointing at the given CloudFront
                distribution. An ``A`` record is always created, and if IPV6 is enabled on
                the given distribution, an ``AAAA`` record will be created as well. Also be
            Severity: Minor
            Found in salt/states/boto_cloudfront.py - About 1 hr to fix

              Function present has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def present(name, listeners, availability_zones=None, subnets=None,
                          subnet_names=None, security_groups=None, scheme='internet-facing',
                          health_check=None, attributes=None,
                          attributes_from_pillar="boto_elb_attributes", cnames=None,
                          alarms=None, alarms_from_pillar="boto_elb_alarms", policies=None,
              Severity: Minor
              Found in salt/states/boto_elb.py - About 1 hr to fix

                Function _mixin_setup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def _mixin_setup(self):
                        actions_group = optparse.OptionGroup(self, 'Actions')
                        actions_group.set_conflict_handler('resolve')
                        actions_group.add_option(
                            '-l', '--list',
                Severity: Minor
                Found in salt/utils/parsers.py - About 1 hr to fix

                  Function sig4 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def sig4(method, endpoint, params, prov_dict,
                           aws_api_version=DEFAULT_AWS_API_VERSION, location=None,
                           product='ec2', uri='/', requesturl=None, data='', headers=None,
                           role_arn=None, payload_hash=None):
                      '''
                  Severity: Minor
                  Found in salt/utils/aws.py - About 1 hr to fix

                    Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def __init__(self,
                                     args=None,
                                     executable=None,
                                     shell=False,
                                     cwd=None,
                    Severity: Minor
                    Found in salt/utils/vt.py - About 1 hr to fix

                      Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def __init__(self,
                                       module_dirs,
                                       opts=None,
                                       tag='module',
                                       loaded_base_name=None,
                      Severity: Minor
                      Found in salt/loader.py - About 1 hr to fix

                        Function create_node has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        def create_node(vm_):
                            '''
                            Build and submit the XML to create a node
                            '''
                            # Start the tree
                        Severity: Minor
                        Found in salt/cloud/clouds/parallels.py - About 1 hr to fix

                          Function post_master_init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          def post_master_init(self, master):
                          
                              log.debug("subclassed LazyLoaded _post_master_init")
                              if self.connected:
                                  self.opts['master'] = master
                          Severity: Minor
                          Found in salt/metaproxy/proxy.py - About 1 hr to fix

                            Function attr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                attr: function( elem, name, value ) {
                                    var hooks, notxml, ret,
                                        nType = elem.nodeType;
                            
                                    // don't get/set attributes on text, comment and attribute nodes
                            Severity: Minor
                            Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                              Function setOffset has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  setOffset: function( elem, options, i ) {
                                      var position = jQuery.css( elem, "position" );
                              
                                      // set position first, in-case top/left are set even on static elem
                                      if ( position === "static" ) {
                              Severity: Minor
                              Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                                Function fixCloneNodeIssues has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function fixCloneNodeIssues( src, dest ) {
                                    var nodeName, e, data;
                                
                                    // We do not need to do anything for non-Elements
                                    if ( dest.nodeType !== 1 ) {
                                Severity: Minor
                                Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                                  Function load has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  jQuery.fn.load = function( url, params, callback ) {
                                      if ( typeof url !== "string" && _load ) {
                                          return _load.apply( this, arguments );
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                                    Function managed has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    def managed(name,
                                                data,
                                                **kwargs):
                                        '''
                                        Manage the device configuration given the input data structured
                                    Severity: Minor
                                    Found in salt/states/net_napalm_yang.py - About 1 hr to fix

                                      Function jdbc_datasource_present has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      def jdbc_datasource_present(name,
                                                                  description='',
                                                                  enabled=True,
                                                                  restype='datasource',
                                                                  vendor='mysql',
                                      Severity: Minor
                                      Found in salt/states/glassfish.py - About 1 hr to fix

                                        Function parse_auth has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        def parse_auth(rule):
                                            '''
                                            Parses the auth/authconfig line
                                            '''
                                            parser = argparse.ArgumentParser()
                                        Severity: Minor
                                        Found in salt/utils/kickstart.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language