saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File roots.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
The default file server backend

This fileserver backend serves files from the Master's local filesystem. If
Severity: Minor
Found in salt/fileserver/roots.py - About 5 hrs to fix

    File mac_shadow.py has 372 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Manage macOS local directory passwords and policies
    
    .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/mac_shadow.py - About 4 hrs to fix

      File git_pillar.py has 372 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Use a git repository as a Pillar source
      ---------------------------------------
      
      
      Severity: Minor
      Found in salt/pillar/git_pillar.py - About 4 hrs to fix

        Function group_installed has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def group_installed(name, skip=None, include=None, **kwargs):
            '''
            .. versionadded:: 2015.8.0
        
            .. versionchanged:: 2016.11.0
        Severity: Minor
        Found in salt/states/pkg.py - About 4 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 _item_present has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def _item_present(name, item, item_id, item_type, show='show', create='create', extra_args=None, cibname=None):
            '''
            Ensure that an item is created
        
            name
        Severity: Minor
        Found in salt/states/pcs.py - About 4 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 service has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def service(name,
                    ports=None,
                    protocols=None):
            '''
            Ensure the service exists and encompasses the specified ports and
        Severity: Minor
        Found in salt/states/firewalld.py - About 4 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 config_unset has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def config_unset(name,
                         value_regex=None,
                         repo=None,
                         user=None,
                         password=None,
        Severity: Minor
        Found in salt/states/git.py - About 4 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 image_absent has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def image_absent(name):
            '''
            Ensure image is absent on the computenode
        
            name : string
        Severity: Minor
        Found in salt/states/smartos.py - About 4 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_rule_changes has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def _get_rule_changes(rules, _rules):
            '''
            given a list of desired rules (rules) and existing rules (_rules) return
            a list of rules to delete (to_delete) and to create (to_create)
            '''
        Severity: Minor
        Found in salt/states/boto_secgroup.py - About 4 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_cmd has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def _run_cmd(self, cmd, key_accept=False, passwd_retries=3):
                '''
                Execute a shell command via VT. This is blocking and assumes that ssh
                is being run
                '''
        Severity: Minor
        Found in salt/client/ssh/shell.py - About 4 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 repack_dictlist has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def repack_dictlist(data,
                            strict=False,
                            recurse=False,
                            key_cb=None,
                            val_cb=None):
        Severity: Minor
        Found in salt/utils/data.py - About 4 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 _check_ipcidr_minions has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def _check_ipcidr_minions(self, expr, greedy):
                '''
                Return the minions found by looking via ipcidr
                '''
                cache_enabled = self.opts.get('minion_data_cache', False)
        Severity: Minor
        Found in salt/utils/minions.py - About 4 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 __fork_ptys has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

                def __fork_ptys(self):
                    '''
                    Fork the PTY
        
                    The major difference from the python source is that we separate the
        Severity: Minor
        Found in salt/utils/vt.py - About 4 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 list_pkgs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def list_pkgs(versions_as_list=False,
                      removed=False,
                      purge_desired=False,
                      **kwargs):  # pylint: disable=W0613
            '''
        Severity: Minor
        Found in salt/modules/aptpkg.py - About 4 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 bootstrap has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def bootstrap(force=False, source=None):
            '''
            Download and install the latest version of the Chocolatey package manager
            via the official bootstrap.
        
        
        Severity: Minor
        Found in salt/modules/chocolatey.py - About 4 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 user_chpass has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def user_chpass(user,
                        host='localhost',
                        password=None,
                        password_hash=None,
                        allow_passwordless=False,
        Severity: Minor
        Found in salt/modules/mysql.py - About 4 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 _dict_lookup_bitwise_add has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def _dict_lookup_bitwise_add(cls, item, **kwargs):
                '''
                kwarg value_lookup bool to determine if item_list should be compared to keys
                or values
        
        
        Severity: Minor
        Found in salt/modules/win_lgpo.py - About 4 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 _atq has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def _atq(**kwargs):
            '''
            Return match jobs list
            '''
        
        
        Severity: Minor
        Found in salt/modules/at.py - About 4 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 atq has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def atq(tag=None):
            '''
            List all queued and running jobs or only those with
            an optional 'tag'.
        
        
        Severity: Minor
        Found in salt/modules/at.py - About 4 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 list_all has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def list_all(prefix=None, app=None, owner=None, description_contains=None,
                     name_not_contains=None, profile="splunk"):
            '''
            Get all splunk search details. Produces results that can be used to create
            an sls file.
        Severity: Minor
        Found in salt/modules/splunk_search.py - About 4 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