saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function file_list_emptydirs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def file_list_emptydirs(self, load):
        '''
        List all emptydirs in the given environment
        '''
        if 'env' in load:
Severity: Minor
Found in salt/fileserver/__init__.py - About 35 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 _validate_config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _validate_config():
    '''
    Validate azurefs config, return False if it doesn't validate
    '''
    if not isinstance(__opts__['azurefs'], list):
Severity: Minor
Found in salt/fileserver/azurefs.py - About 35 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 _env_root has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _env_root(repo, saltenv):
    '''
    Return the root of the directory corresponding to the desired environment,
    or None if the environment was not found.
    '''
Severity: Minor
Found in salt/fileserver/svnfs.py - About 35 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 _get_ref has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _get_ref(repo, name):
    '''
    Return ref tuple if ref is in the repo.
    '''
    if name == 'base':
Severity: Minor
Found in salt/fileserver/hgfs.py - About 35 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 file_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def file_list(self, load):
        '''
        Return a list of files from the dominant environment
        '''
        if 'env' in load:
Severity: Minor
Found in salt/fileserver/__init__.py - About 35 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 find_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def find_file(path, tgt_env='base', **kwargs):  # pylint: disable=W0613
    '''
    Search the environment for the relative path
    '''
    fnd = {'path': '', 'rel': ''}
Severity: Minor
Found in salt/fileserver/minionfs.py - About 35 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 dir_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def dir_list(self, load):
        '''
        List all directories in the given environment
        '''
        if 'env' in load:
Severity: Minor
Found in salt/fileserver/__init__.py - About 35 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 symlink_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def symlink_list(self, load):
        '''
        Return a list of symlinked files and dirs
        '''
        if 'env' in load:
Severity: Minor
Found in salt/fileserver/__init__.py - About 35 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 too many return statements within this function.
Open

        return jQuery.makeArray( selector, this );
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return ret
    Severity: Major
    Found in salt/transport/mixins/auth.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return {'enc': 'clear',
      Severity: Major
      Found in salt/transport/mixins/auth.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return dest
        Severity: Major
        Found in salt/fileclient.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return results;
          Severity: Major
          Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return 'eq'
            Severity: Major
            Found in setup.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return src
              Severity: Major
              Found in salt/transport/frame.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return src
                Severity: Major
                Found in salt/transport/frame.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return dest
                  Severity: Major
                  Found in salt/fileclient.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return tuple(obj)
                    Severity: Major
                    Found in salt/payload.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return ret == null ?
                                      undefined :
                                      ret;
                      Severity: Major
                      Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return results;
                        Severity: Major
                        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language