saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function netstats has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
Open

def netstats():
    '''
    Return the network stats for this minion

    .. versionchanged:: 2016.11.4
Severity: Minor
Found in salt/modules/status.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 get_managed has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
Open

def get_managed(
        name,
        template,
        source,
        source_hash,
Severity: Minor
Found in salt/modules/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

File win_wua.py has 669 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for managing Windows Updates using the Windows Update Agent.

List updates on the system using the following functions:
Severity: Major
Found in salt/modules/win_wua.py - About 1 day to fix

    File __init__.py has 665 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Salt's pluggable authentication system
    
    This system allows for authentication to be managed in a module pluggable way
    Severity: Major
    Found in salt/auth/__init__.py - About 1 day to fix

      File boto_secgroup.py has 665 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage Security Groups
      ======================
      
      
      Severity: Major
      Found in salt/states/boto_secgroup.py - About 1 day to fix

        Function get_file has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_file(self,
                         path,
                         dest='',
                         makedirs=False,
                         saltenv='base',
        Severity: Minor
        Found in salt/fileclient.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 security_rule_exists has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

        def security_rule_exists(name,
                                 rulename=None,
                                 vsys='1',
                                 action=None,
                                 disabled=None,
        Severity: Minor
        Found in salt/states/panos.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 gen_min has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

        def gen_min(cachedir, extra_mods='', overwrite=False, so_mods='',
                    python2_bin='python2', python3_bin='python3'):
            '''
            Generate the salt-min tarball and print the location of the tarball
            Optional additional mods to include (e.g. mako) can be supplied as a comma
        Severity: Minor
        Found in salt/utils/thin.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 _load_policy_definitions has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

        def _load_policy_definitions(path='c:\\Windows\\PolicyDefinitions',
                                     language='en-US'):
            '''
            helper function to process all ADMX files in the specified policy_def_path
            and build a single XML doc that we can search/use for ADMX policy processing
        Severity: Minor
        Found in salt/modules/win_lgpo.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 destroy has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

            def destroy(self, names, cached=False):
                '''
                Destroy the named VMs
                '''
                processed = {}
        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

        Function compile_high_data has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

            def compile_high_data(self, high):
                '''
                "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

        Function ext_pillar has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

        def ext_pillar(minion_id,
                       pillar,  # pylint: disable=W0613
                       **kwargs):
            '''
            Check vmware/vcenter for all data
        Severity: Minor
        Found in salt/pillar/vmware_pillar.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 process has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

            def process(self, config, grains):
                '''
                Process the configured beacons
        
                The config must be a list and looks like this in yaml
        Severity: Minor
        Found in salt/beacons/__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 svnfs.py has 663 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Subversion Fileserver Backend
        
        After enabling this backend, branches and tags in a remote subversion
        Severity: Major
        Found in salt/fileserver/svnfs.py - About 1 day to fix

          File boto_iam_role.py has 659 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Manage IAM roles
          ================
          
          
          Severity: Major
          Found in salt/states/boto_iam_role.py - About 1 day to fix

            File rpm_lowpkg.py has 659 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Support for rpm
            '''
            
            
            Severity: Major
            Found in salt/modules/rpm_lowpkg.py - About 1 day to fix

              File firewalld.py has 658 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Support for firewalld.
              
              .. versionadded:: 2015.2.0
              Severity: Major
              Found in salt/modules/firewalld.py - About 1 day to fix

                File namecheap_ssl.py has 658 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Namecheap SSL Certificate Management
                
                .. versionadded:: 2017.7.0
                Severity: Major
                Found in salt/modules/namecheap_ssl.py - About 1 day to fix

                  File qingcloud.py has 658 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    Function set_job has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def set_job(user,
                                minute,
                                hour,
                                daymonth,
                                month,
                    Severity: Minor
                    Found in salt/modules/cron.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