saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function prepare has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def prepare(self):
        '''
        Run the preparation sequence required to start a salt proxy minion.

        If sub-classed, don't **ever** forget to run:
Severity: Minor
Found in salt/cli/daemons.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 target_load has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def target_load(self, load):
    # Verify that the publication is valid
    if 'tgt' not in load or 'jid' not in load or 'fun' not in load \
        or 'arg' not in load:
        return False
Severity: Minor
Found in salt/metaproxy/proxy.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 _post_master_init has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def _post_master_init(self, master):
        '''
        Function to finish init after connecting to a master

        This is primarily loading modules, pillars, etc. (since they need
Severity: Minor
Found in salt/minion.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 _target_load has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def _target_load(self, load):
        # Verify that the publication is valid
        if 'tgt' not in load or 'jid' not in load or 'fun' not in load \
           or 'arg' not in load:
            return False
Severity: Minor
Found in salt/minion.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 _return_pub_syndic has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def _return_pub_syndic(self, values, master_id=None):
        '''
        Wrapper to call the '_return_pub_multi' a syndic, best effort to get the one you asked for
        '''
        func = '_return_pub_multi'
Severity: Minor
Found in salt/minion.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 prepare_rows has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def prepare_rows(self,
                     rows,
                     indent,
                     has_header):

Severity: Minor
Found in salt/output/table_out.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 gen_keys has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def gen_keys(keydir, keyname, keysize, user=None, passphrase=None):
    '''
    Generate a RSA public keypair for use with salt

    :param str keydir: The directory to write the keypair to
Severity: Minor
Found in salt/crypt.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 file_hash has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def file_hash(load, fnd):
    '''
    Return a file hash, the hash type is set in the master config file
    '''
    path = fnd['path']
Severity: Minor
Found in salt/fileserver/minionfs.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 find_file has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def find_file(path, saltenv='base', **kwargs):
    '''
    Look through the buckets cache file for a match.
    If the field is found, it is retrieved from S3 only if its cached version
    is missing, or if the MD5 does not match.
Severity: Minor
Found in salt/fileserver/s3fs.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 ajaxHandleResponses has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ajaxHandleResponses( s, jqXHR, responses ) {
    var firstDataType, ct, finalDataType, type,
        contents = s.contents,
        dataTypes = s.dataTypes,
        responseFields = s.responseFields;
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

    Function __collect_software_info has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __collect_software_info(self, sid, key_software, use_32bit):
            '''
            Update data with the next software found
            '''
    
    
    Severity: Minor
    Found in salt/utils/pkg/win.py - About 1 hr to fix

      Function create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def create(vm_):
          '''
          Create a single Linode VM.
          '''
          name = vm_['name']
      Severity: Minor
      Found in salt/cloud/clouds/linode.py - About 1 hr to fix

        Function matcherFromTokens has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function matcherFromTokens( tokens ) {
            var checkContext, matcher, j,
                len = tokens.length,
                leadingRelative = Expr.relative[ tokens[0].type ],
                implicitRelative = leadingRelative || Expr.relative[" "],
        Severity: Minor
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

          Function show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , show: function () {
                var $tip
                  , pos
                  , actualWidth
                  , actualHeight
          Severity: Minor
          Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js - About 1 hr to fix

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

            def install(pkgs=None,  # pylint: disable=R0912,R0913,R0914
                        requirements=None,
                        bin_env=None,
                        use_wheel=False,
                        no_use_wheel=False,
            Severity: Minor
            Found in salt/modules/pip.py - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                              ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                              ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                              !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
              
              
              Severity: Critical
              Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - 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)):
                                                                    list_strings = []
                                                                    if base_policy_settings[adm_namespace][admPolicy][child_item.attrib['id']]:
                                                                        list_strings = _checkListItem(child_item,
                Severity: Critical
                Found in salt/modules/win_lgpo.py - About 1 hr to fix

                  Function val has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      val: function( value ) {
                          var ret, hooks, isFunction,
                              elem = this[0];
                  
                          if ( !arguments.length ) {
                  Severity: Minor
                  Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                    Function addCombinator has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addCombinator( matcher, combinator, base ) {
                        var dir = combinator.dir,
                            checkNonElements = base && dir === "parentNode",
                            doneName = done++;
                    
                    
                    Severity: Minor
                    Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                      Function create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def create(vm_):
                          '''
                          Create a single VM from a data dict
                          '''
                          try:
                      Severity: Minor
                      Found in salt/cloud/clouds/msazure.py - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language