saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File reg.py has 458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================

Severity: Minor
Found in salt/states/reg.py - About 7 hrs to fix

    File statuspage.py has 458 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    StatusPage
    ==========
    
    
    Severity: Minor
    Found in salt/modules/statuspage.py - About 7 hrs to fix

      File jboss7.py has 457 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage JBoss 7 Application Server via CLI interface
      
      .. versionadded:: 2015.5.0
      Severity: Minor
      Found in salt/states/jboss7.py - About 7 hrs to fix

        File solarisipspkg.py has 456 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        IPS pkg support for Solaris
        
        .. important::
        Severity: Minor
        Found in salt/modules/solarisipspkg.py - About 6 hrs to fix

          File collector.py has 456 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # coding=utf-8
          from __future__ import absolute_import, print_function, unicode_literals
          import os
          import sys
          import copy
          Severity: Minor
          Found in salt/cli/support/collector.py - About 6 hrs to fix

            File esxvm.py has 455 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Salt state to create, update VMware ESXi Virtual Machines.
            
            Dependencies
            Severity: Minor
            Found in salt/states/esxvm.py - About 6 hrs to fix

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

              def managed(name,
                          config,
                          api_url=None,
                          page_id=None,
                          api_key=None,
              Severity: Minor
              Found in salt/states/statuspage.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 topic_present has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def topic_present(name, subscriptions=None, attributes=None,
                                region=None, key=None, keyid=None, profile=None):
                  '''
                  Ensure the SNS topic exists.
              
              
              Severity: Minor
              Found in salt/states/boto3_sns.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 managed has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def managed(name, entries, connect_spec=None):
                  '''Ensure the existence (or not) of LDAP entries and their attributes
              
                  Example:
              
              
              Severity: Minor
              Found in salt/states/ldap.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 swap has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def swap(name, persist=True, config='/etc/fstab'):
                  '''
                  Activates a swap device
              
                  .. code-block:: yaml
              Severity: Minor
              Found in salt/states/mount.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 delete has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def delete(name, table='filter', family='ipv4', **kwargs):
                  '''
                  .. versionadded:: 2014.1.0
              
                  Delete a rule to a chain
              Severity: Minor
              Found in salt/states/iptables.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 default_vsan_policy_configured has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def default_vsan_policy_configured(name, policy):
                  '''
                  Configures the default VSAN policy on a vCenter.
                  The state assumes there is only one default VSAN policy on a vCenter.
              
              
              Severity: Minor
              Found in salt/states/pbm.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_service_instance has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def _get_service_instance(host, username, password, protocol,
                                        port, mechanism, principal, domain):
                  '''
                  Internal method to authenticate with a vCenter server or ESX/ESXi host
                  and return the service instance object.
              Severity: Minor
              Found in salt/utils/vmware.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 connected_ids has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                  def connected_ids(self, subset=None, show_ip=False, show_ipv4=None, include_localhost=None):
                      '''
                      Return a set of all connected minion ids, optionally within a subset
                      '''
                      if include_localhost is not None:
              Severity: Minor
              Found in salt/utils/minions.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 set_volumes_tags has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def set_volumes_tags(tag_maps, authoritative=False, dry_run=False,
                                  region=None, key=None, keyid=None, profile=None):
                  '''
                  .. versionadded:: 2016.11.0
              
              
              Severity: Minor
              Found in salt/modules/boto_ec2.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 verify_data has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                  def verify_data(self, data):
                      '''
                      Verify the data, return an error statement if something is wrong
                      '''
                      errors = []
              Severity: Minor
              Found in salt/state.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 _thread_multi_return has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _thread_multi_return(cls, minion_instance, opts, data):
                      '''
                      This method should be used as a threading target, start the actual
                      minion side execution.
                      '''
              Severity: Minor
              Found in salt/minion.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 thread_multi_return has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

              def thread_multi_return(cls, minion_instance, opts, data):
                  '''
                  This method should be used as a threading target, start the actual
                  minion side execution.
                  '''
              Severity: Minor
              Found in salt/metaproxy/proxy.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 vmware_pillar.py has 454 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Pillar data from vCenter or an ESXi host
              
              .. versionadded:: 2017.7.0
              Severity: Minor
              Found in salt/pillar/vmware_pillar.py - About 6 hrs to fix

                File junos.py has 453 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                State modules to interact with Junos devices.
                ==============================================
                
                
                Severity: Minor
                Found in salt/states/junos.py - About 6 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language