saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File fileclient.py has 1160 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Classes that manage file clients
'''
from __future__ import absolute_import, print_function, unicode_literals
Severity: Major
Found in salt/fileclient.py - About 2 days to fix

    Function Modernizr has 594 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.6.2',
    
        Modernizr = {},

      Function make_repo has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
      Open

      def make_repo(repodir,
                    keyid=None,
                    env=None,
                    use_passphrase=False,
                    gnupghome='/etc/salt/gpgkeys',
      Severity: Minor
      Found in salt/modules/debuild_pkgbuild.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 nspawn.py has 1153 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage nspawn containers
      
      .. versionadded:: 2015.8.0
      Severity: Major
      Found in salt/modules/nspawn.py - About 2 days to fix

        File nova.py has 1151 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          File nova.py has 1137 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Nova class
          '''
          
          
          Severity: Major
          Found in salt/utils/openstack/nova.py - About 2 days to fix

            Function install has a Cognitive Complexity of 142 (exceeds 5 allowed). Consider refactoring.
            Open

            def install(name=None,
                        refresh=False,
                        fromrepo=None,
                        skip_verify=False,
                        debconf=None,
            Severity: Minor
            Found in salt/modules/aptpkg.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 set_ has a Cognitive Complexity of 141 (exceeds 5 allowed). Consider refactoring.
            Open

            def set_(name,
                     setting=None,
                     policy_class=None,
                     computer_policy=None,
                     user_policy=None,
            Severity: Minor
            Found in salt/states/win_lgpo.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 install has a Cognitive Complexity of 140 (exceeds 5 allowed). Consider refactoring.
            Open

            def install(pkgs=None,  # pylint: disable=R0912,R0913,R0914
                        requirements=None,
                        bin_env=None,
                        use_wheel=False,
                        no_use_wheel=False,
            Severity: Minor
            Found in salt/modules/pip.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 138 (exceeds 5 allowed). Consider refactoring.
            Open

            def present(name, brand, zonepath, properties=None, resources=None):
                '''
                Ensure a zone with certain properties and resources
            
                name : string
            Severity: Minor
            Found in salt/states/zone.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 138 (exceeds 5 allowed). Consider refactoring.
            Open

            def present(host, groups, interfaces, **kwargs):
                '''
                Ensures that the host exists, eventually creates new host.
                NOTE: please use argument visible_name instead of name to not mess with name from salt sls. This function accepts
                all standard host properties: keyword argument names differ depending on your zabbix version, see:
            Severity: Minor
            Found in salt/states/zabbix_host.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 dacl has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
            Open

            def dacl(obj_name=None, obj_type='file'):
                '''
                Helper function for instantiating a Dacl class.
            
                Args:
            Severity: Minor
            Found in salt/utils/win_dacl.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 init has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
            Open

            def init(name,
                     config=None,
                     cpuset=None,
                     cpushare=None,
                     memory=None,
            Severity: Minor
            Found in salt/modules/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 _processValueItem has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
            Open

            def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
                                  check_deleted=False, this_element_value=None):
                '''
                helper function to process a value type item and generate the expected
                string in the Registry.pol file
            Severity: Minor
            Found in salt/modules/win_lgpo.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 eval_master has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
            Open

                def eval_master(self,
                                opts,
                                timeout=60,
                                safe=True,
                                failed=False,
            Severity: Minor
            Found in salt/minion.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 win_system.py has 1099 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Module for managing windows systems.
            
            :depends:
            Severity: Major
            Found in salt/modules/win_system.py - About 2 days to fix

              Function list_ has a Cognitive Complexity of 137 (exceeds 5 allowed). Consider refactoring.
              Open

              def list_(name,
                        archive_format=None,
                        options=None,
                        strip_components=None,
                        clean=False,
              Severity: Minor
              Found in salt/modules/archive.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 cmd.py has 1089 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Execution of arbitrary commands
              ===============================
              
              
              Severity: Major
              Found in salt/states/cmd.py - About 2 days to fix

                File win_service.py has 1085 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Windows Service module.
                
                .. versionchanged:: 2016.11.0 - Rewritten to use PyWin32
                Severity: Major
                Found in salt/modules/win_service.py - About 2 days to fix

                  Function render_pstate has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def render_pstate(self, sls, saltenv, mods, defaults=None):
                          '''
                          Collect a single pillar sls file and render it
                          '''
                          if defaults is None:
                  Severity: Minor
                  Found in salt/pillar/__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

                  Severity
                  Category
                  Status
                  Source
                  Language