saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File syslog_ng.py has 898 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for getting information about syslog-ng

:maintainer:    Tibor Benke <btibi@sch.bme.hu>
Severity: Major
Found in salt/modules/syslog_ng.py - About 2 days to fix

    Function list_present has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
    Open

    def list_present(name, acl_type, acl_names=None, perms='', recurse=False, force=False):
        '''
        Ensure a Linux ACL list is present
    
        Takes a list of acl names and add them to the given path
    Severity: Minor
    Found in salt/states/linux_acl.py - About 2 days 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 _tags_present has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
    Open

    def _tags_present(name, tags, vpc_id=None, vpc_name=None, region=None,
                      key=None, keyid=None, profile=None):
        '''
        helper function to validate tags are correct
        '''
    Severity: Minor
    Found in salt/states/boto_secgroup.py - About 2 days 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_env has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
    Open

    def verify_env(
            dirs,
            user,
            permissive=False,
            pki_dir='',
    Severity: Minor
    Found in salt/utils/verify.py - About 2 days 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 blockreplace has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
    Open

    def blockreplace(path,
            marker_start='#-- start managed zone --',
            marker_end='#-- end managed zone --',
            content='',
            append_if_not_found=False,
    Severity: Minor
    Found in salt/modules/file.py - About 2 days 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 zfs.py has 874 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for running ZFS command
    
    :codeauthor:    Nitin Madhok <nmadhok@clemson.edu>, Jorge Schrauwen <sjorge@blackdot.be>
    Severity: Major
    Found in salt/modules/zfs.py - About 2 days to fix

      File zcbuildout.py has 873 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Management of zc.buildout
      
      .. versionadded:: 2014.1.0
      Severity: Major
      Found in salt/modules/zcbuildout.py - About 2 days to fix

        Function _tags_present has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
        Open

        def _tags_present(name, tags, region, key, keyid, profile):
            '''
            helper function to validate tags on elb
            '''
            ret = {'result': True, 'comment': '', 'changes': {}}
        Severity: Minor
        Found in salt/states/boto_elb.py - About 2 days 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 port_bindings has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
        Open

        def port_bindings(val, **kwargs):
            '''
            On the CLI, these are passed as multiple instances of a given CLI option.
            In Salt, we accept these as a comma-delimited list but the API expects a
            Python dictionary mapping ports to their bindings. The format the API
        Severity: Minor
        Found in salt/utils/docker/translate/container.py - About 2 days 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_hwclock has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_hwclock():
            '''
            Get current hardware clock setting (UTC or localtime)
        
            CLI Example:
        Severity: Minor
        Found in salt/modules/timezone.py - About 2 days 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 apply_cloud_providers_config has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
        Open

        def apply_cloud_providers_config(overrides, defaults=None):
            '''
            Apply the loaded cloud providers configuration.
            '''
            if defaults is None:
        Severity: Minor
        Found in salt/config/__init__.py - About 2 days 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 104 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(name,
                    running=None,
                    clone_from=None,
                    snapshot=False,
                    profile=None,
        Severity: Minor
        Found in salt/states/lxc.py - About 2 days 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 eni_present has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
        Open

        def eni_present(
                name,
                subnet_id=None,
                subnet_name=None,
                private_ip_address=None,
        Severity: Minor
        Found in salt/states/boto_ec2.py - About 2 days 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 joyent.py has 863 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Joyent Cloud Module
        ===================
        
        
        Severity: Major
        Found in salt/cloud/clouds/joyent.py - About 2 days to fix

          File saltmod.py has 860 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Control the Salt command interface
          ==================================
          
          
          Severity: Major
          Found in salt/states/saltmod.py - About 2 days to fix

            File data.py has 860 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Functions for manipulating, inspecting, or otherwise working with data types
            and data structures.
            '''
            Severity: Major
            Found in salt/utils/data.py - About 2 days to fix

              File chocolatey.py has 859 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              A dead simple module wrapping calls to the Chocolatey package manager
              (http://chocolatey.org)
              
              
              Severity: Major
              Found in salt/modules/chocolatey.py - About 2 days to fix

                Function search_onfail_requisites has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
                Open

                def search_onfail_requisites(sid, highstate):
                    '''
                    For a particular low chunk, search relevant onfail related states
                    '''
                    onfails = []
                Severity: Minor
                Found in salt/utils/state.py - About 2 days 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 setup.py has 851 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                    :codeauthor: Pedro Algarvio (pedro@algarvio.me)
                
                
                
                Severity: Major
                Found in salt/log/setup.py - About 2 days to fix

                  Function grains has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def grains(opts, force_refresh=False, proxy=None):
                      '''
                      Return the functions for the dynamic grains and the values for the static
                      grains.
                  
                  
                  Severity: Minor
                  Found in salt/loader.py - About 2 days 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