saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File files.py has 716 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Functions for working with files
'''

Severity: Major
Found in salt/utils/files.py - About 1 day to fix

    File docker_network.py has 713 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Management of Docker networks
    
    .. versionadded:: 2017.7.0
    Severity: Major
    Found in salt/states/docker_network.py - About 1 day to fix

      File win_reg.py has 712 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage the Windows registry
      
      -----
      Severity: Major
      Found in salt/utils/win_reg.py - About 1 day to fix

        Function managed has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        def managed(name, type, enabled=True, **kwargs):
            '''
            Ensure that the named interface is configured properly.
        
            name
        Severity: Minor
        Found in salt/states/network.py - About 1 day 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 state has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        def state(name,
                tgt,
                ssh=False,
                tgt_type='glob',
                ret='',
        Severity: Minor
        Found in salt/states/saltmod.py - About 1 day 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 _mixin_after_parsed has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

            def _mixin_after_parsed(self):
                if len(self.args) <= 1 and not self.options.doc and not self.options.preview_target:
                    try:
                        self.print_help()
                    except Exception:  # pylint: disable=broad-except
        Severity: Minor
        Found in salt/utils/parsers.py - About 1 day 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 del_repo has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        def del_repo(repo, **kwargs):
            '''
            Delete a repo from the sources.list / sources.list.d
        
            If the .list file is in the sources.list.d directory
        Severity: Minor
        Found in salt/modules/aptpkg.py - About 1 day 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 boto_route53.py has 710 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Connection module for Amazon Route53
        
        .. versionadded:: 2014.7.0
        Severity: Major
        Found in salt/modules/boto_route53.py - About 1 day to fix

          File openstack.py has 708 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Openstack Cloud Driver
          ======================
          
          
          Severity: Major
          Found in salt/cloud/clouds/openstack.py - About 1 day to fix

            Function latest has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

            def latest(
                    name,
                    refresh=None,
                    fromrepo=None,
                    skip_verify=False,
            Severity: Minor
            Found in salt/states/pkg.py - About 1 day 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 edit_task has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

            def edit_task(name=None,
                          location='\\',
                          # General Tab
                          user_name=None,
                          password=None,
            Severity: Minor
            Found in salt/modules/win_task.py - About 1 day 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 compile_high_data has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

                def compile_high_data(self, high, orchestration_jid=None):
                    '''
                    "Compile" the high data as it is retrieved from the CLI or YAML into
                    the individual state executor structures
                    '''
            Severity: Minor
            Found in salt/state.py - About 1 day 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 vt.py has 699 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
                :codeauthor: Pedro Algarvio (pedro@algarvio.me)
            
            
            
            Severity: Major
            Found in salt/utils/vt.py - About 1 day to fix

              Function present has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
              Open

              def present(name=None, data=None, ensure_data=True, **api_opts):
                  '''
                  This will ensure that a host with the provided name exists.
                  This will try to ensure that the state of the host matches the given data
                  If the host is not found then one will be created.
              Severity: Minor
              Found in salt/states/infoblox_host_record.py - About 1 day 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 _changes has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
              Open

              def _changes(name,
                           uid=None,
                           gid=None,
                           groups=None,
                           optional_groups=None,
              Severity: Minor
              Found in salt/states/user.py - About 1 day 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 subdict_match has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
              Open

              def subdict_match(data,
                                expr,
                                delimiter=DEFAULT_TARGET_DELIM,
                                regex_match=False,
                                exact_match=False):
              Severity: Minor
              Found in salt/utils/data.py - About 1 day 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 _refresh_file_mapping has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _refresh_file_mapping(self):
                      '''
                      refresh the mapping of the FS on disk
                      '''
                      # map of suffix to description for imp
              Severity: Minor
              Found in salt/loader.py - About 1 day 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 _compare has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
              Open

              def _compare(cur_cmp, cur_struct):
                  '''
                  Compares two objects and return a boolean value
                  when there's a match.
                  '''
              Severity: Minor
              Found in salt/beacons/napalm_beacon.py - About 1 day 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 bcache.py has 697 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Module for managing BCache sets
              
              BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache.
              Severity: Major
              Found in salt/modules/bcache.py - About 1 day to fix

                File win_update.py has 696 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Classes for working with Windows Update Agent
                '''
                # Import Python libs
                Severity: Major
                Found in salt/utils/win_update.py - About 1 day to fix
                  Severity
                  Category
                  Status
                  Source
                  Language