saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function put has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

def put(consul_url=None, token=None, key=None, value=None, **kwargs):
    '''
    Put values into Consul

    :param consul_url: The Consul server URL.
Severity: Minor
Found in salt/modules/consul.py - About 6 hrs 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_tops has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    def get_tops(self):
        '''
        Gather the top files
        '''
        tops = collections.defaultdict(list)
Severity: Minor
Found in salt/pillar/__init__.py - About 6 hrs 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_file_from_s3 has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path):
    '''
    Checks the local cache for the file, if it's old or missing go grab the
    file from S3 and update the cache
    '''
Severity: Minor
Found in salt/fileserver/s3fs.py - About 6 hrs 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_lists has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

def _file_lists(load, form):
    '''
    Return a dict containing the file lists for files, dirs, emptydirs and symlinks
    '''
    if 'env' in load:
Severity: Minor
Found in salt/fileserver/svnfs.py - About 6 hrs 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

File win_dism.py has 433 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Install features/packages for Windows using DISM, which is useful for minions
not running server versions of Windows. Some functions are only available on
Windows 10.
Severity: Minor
Found in salt/modules/win_dism.py - About 6 hrs to fix

    File win_status.py has 432 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for returning various status data about a minion.
    These data can be useful for compiling into stats later,
    or for problem solving if your minion is having problems.
    Severity: Minor
    Found in salt/modules/win_status.py - About 6 hrs to fix

      File conf.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      # pylint: disable=C0103,W0622
      '''
      Sphinx documentation for Salt
      '''
      Severity: Minor
      Found in doc/conf.py - About 6 hrs to fix

        File apkpkg.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Support for apk
        
        .. important::
        Severity: Minor
        Found in salt/modules/apkpkg.py - About 6 hrs to fix

          File packet.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Packet Cloud Module Using Packet's Python API Client
          ====================================================
          
          
          Severity: Minor
          Found in salt/cloud/clouds/packet.py - About 6 hrs to fix

            File highstate_return.py has 430 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Return the results of a highstate (or any other state function that returns
            data in a compatible format) via an HTML email or HTML file.
            
            
            Severity: Minor
            Found in salt/returners/highstate_return.py - About 6 hrs to fix

              File boto_route53.py has 429 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Manage Route53 records
              
              .. versionadded:: 2014.7.0
              Severity: Minor
              Found in salt/states/boto_route53.py - About 6 hrs to fix

                Function _mine_get has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _mine_get(self, load, skip_verify=False):
                        '''
                        Gathers the data from the specified minions' mine
                        '''
                        if not skip_verify:
                Severity: Minor
                Found in salt/daemons/masterapi.py - About 6 hrs 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 cluster_configured has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def cluster_configured(name, cluster_config):
                    '''
                    Configures a cluster. Creates a new cluster, if it doesn't exist on the
                    vCenter or reconfigures it if configured differently
                
                
                Severity: Minor
                Found in salt/states/esxcluster.py - About 6 hrs 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 present has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name, persist=False, mods=None):
                    '''
                    Ensure that the specified kernel module is loaded
                
                    name
                Severity: Minor
                Found in salt/states/kmod.py - About 6 hrs 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 absent has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def absent(name, persist=False, comment=True, mods=None):
                    '''
                    Verify that the named kernel module is not loaded
                
                    name
                Severity: Minor
                Found in salt/states/kmod.py - About 6 hrs 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 query has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def query(name, match=None, match_type='string', status=None, status_type='string', wait_for=None, **kwargs):
                    '''
                    Perform an HTTP query and statefully return the result
                
                    Passes through all the parameters described in the
                Severity: Minor
                Found in salt/states/http.py - About 6 hrs 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 present has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(
                        name,
                        user,
                        enc='ssh-rsa',
                        comment='',
                Severity: Minor
                Found in salt/states/ssh_auth.py - About 6 hrs 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_cli_static_event_returns has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_cli_static_event_returns(
                            self,
                            jid,
                            minions,
                            timeout=None,
                Severity: Minor
                Found in salt/client/__init__.py - About 6 hrs 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 main has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def main(argv):  # pylint: disable=W0613
                    '''
                    Main program body
                    '''
                    thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE)
                Severity: Minor
                Found in salt/client/ssh/ssh_py_shim.py - About 6 hrs 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 run has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                    def run(self):
                        '''
                        Run the logic for saltkey
                        '''
                        self._update_opts()
                Severity: Minor
                Found in salt/key.py - About 6 hrs 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

                Severity
                Category
                Status
                Source
                Language