saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File glusterfs.py has 578 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage a glusterfs pool
'''
from __future__ import absolute_import, unicode_literals, print_function
Severity: Major
Found in salt/modules/glusterfs.py - About 1 day to fix

    File beacons.py has 576 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for managing the Salt beacons on a minion
    
    .. versionadded:: 2015.8.0
    Severity: Major
    Found in salt/modules/beacons.py - About 1 day to fix

      Function _package_conf_ordering has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
      Open

      def _package_conf_ordering(conf, clean=True, keep_backup=False):
          '''
          Move entries in the correct file.
          '''
          if conf in SUPPORTED_CONFS:
      Severity: Minor
      Found in salt/modules/portage_config.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 do_action has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
      Open

          def do_action(self, names, kwargs):
              '''
              Perform an action on a VM which may be specific to this cloud provider
              '''
              ret = {}
      Severity: Minor
      Found in salt/cloud/__init__.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_secgroup.py has 572 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Function ajax has 241 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            ajax: function( url, options ) {
        
                // If url is an object, simulate pre-1.5 signature
                if ( typeof url === "object" ) {
                    options = url;
        Severity: Major
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 day to fix

          Function prepend has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def prepend(name,
                      text=None,
                      makedirs=False,
                      source=None,
                      source_hash=None,
          Severity: Minor
          Found in salt/states/file.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 task_present has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def task_present(name,
                           tick_script,
                           task_type='stream',
                           database=None,
                           retention_policy='default',
          Severity: Minor
          Found in salt/states/kapacitor.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 _diff has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def _diff(state_data, resource_object):
              '''helper method to compare salt state info with the PagerDuty API json structure,
              and determine if we need to update.
          
              returns the dict to pass to the PD API to perform the update, or empty dict if no update.
          Severity: Minor
          Found in salt/states/pagerduty_schedule.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 _elb_present has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def _elb_present(name, availability_zones, listeners, subnets, subnet_names,
                           security_groups, scheme, region, key, keyid, profile):
              ret = {'result': True, 'comment': '', 'changes': {}}
              if not salt.utils.data.exactly_one((availability_zones, subnets, subnet_names)):
                  raise SaltInvocationError('Exactly one of availability_zones, subnets, '
          Severity: Minor
          Found in salt/states/boto_elb.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_and_update_config has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def compare_and_update_config(config, update_config, changes, namespace=''):
              '''
              Recursively compare two configs, writing any needed changes to the
              update_config and capturing changes in the changes dict.
              '''
          Severity: Minor
          Found in salt/utils/configcomparer.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 install has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def install(name=None,
                      refresh=False,
                      sysupgrade=None,
                      pkgs=None,
                      sources=None,
          Severity: Minor
          Found in salt/modules/pacmanpkg.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 update has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          def update(name,
                     cpu=0,
                     mem=0,
                     disk_profile=None,
                     disks=None,
          Severity: Minor
          Found in salt/modules/virt.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 run has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

              def run(self):
                  '''
                  Execute the salt command line
                  '''
                  import salt.client
          Severity: Minor
          Found in salt/cli/salt.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 network.py has 564 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Configuration of network interfaces
          ===================================
          
          
          Severity: Major
          Found in salt/states/network.py - About 1 day to fix

            File venafiapi.py has 562 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Support for Venafi
            
            Before using this module you need to register an account with Venafi, and
            Severity: Major
            Found in salt/runners/venafiapi.py - About 1 day to fix

              File virtualbox.py has 561 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Utilities to help make requests to virtualbox
              
              The virtualbox SDK reference can be found at http://download.virtualbox.org/virtualbox/SDKRef.pdf
              Severity: Major
              Found in salt/utils/virtualbox.py - About 1 day to fix

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

                def present(name,
                            createdb=None,
                            createroles=None,
                            encrypted=None,
                            superuser=None,
                Severity: Minor
                Found in salt/states/postgres_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 run has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                Open

                def run(name,
                        database,
                        query,
                        output=None,
                        grain=None,
                Severity: Minor
                Found in salt/states/mysql_query.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 _action has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                Open

                def _action(action='get', search=None, one=True, force=False):
                    '''
                    Multi action helper for start, stop, get, ...
                    '''
                    vms = {}
                Severity: Minor
                Found in salt/runners/smartos_vmadm.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

                Severity
                Category
                Status
                Source
                Language