saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File zpool.py has 1074 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for running ZFS zpool command

:codeauthor:    Nitin Madhok <nmadhok@clemson.edu>, Jorge Schrauwen <sjorge@blackdot.be>
Severity: Major
Found in salt/modules/zpool.py - About 2 days to fix

    Function keyvalue has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
    Open

    def keyvalue(
            name,
            key=None,
            value=None,
            key_values=None,
    Severity: Minor
    Found in salt/states/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 boto3_elasticache.py has 1070 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Manage Elasticache with boto3
    =============================
    
    
    Severity: Major
    Found in salt/states/boto3_elasticache.py - About 2 days to fix

      File zeromq.py has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Zeromq transport classes
      '''
      
      
      Severity: Major
      Found in salt/transport/zeromq.py - About 2 days to fix

        File ssh.py has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Manage client ssh components
        
        .. note::
        Severity: Major
        Found in salt/modules/ssh.py - About 2 days to fix

          File digitalocean.py has 1066 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            File xen.py has 1062 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

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

              def install(name=None, refresh=False, pkgs=None, **kwargs):
                  r'''
                  Install the passed package(s) on the system using winrepo
              
                  Args:
              Severity: Minor
              Found in salt/modules/win_pkg.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 keystone.py has 1059 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Module for handling openstack keystone calls.
              
              :optdepends:    - keystoneclient Python adapter
              Severity: Major
              Found in salt/modules/keystone.py - About 2 days to fix

                File mount.py has 1057 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Mounting of filesystems
                =======================
                
                
                Severity: Major
                Found in salt/states/mount.py - About 2 days to fix

                  File solr.py has 1053 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Apache Solr Salt Module
                  
                  Author: Jed Glazner
                  Severity: Major
                  Found in salt/modules/solr.py - About 2 days to fix

                    File archive.py has 1053 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    A module to wrap (non-Windows) archive calls
                    
                    .. versionadded:: 2014.1.0
                    Severity: Major
                    Found in salt/modules/archive.py - About 2 days to fix

                      File systemd_service.py has 1051 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Provides the service module for systemd
                      
                      .. versionadded:: 0.10.0
                      Severity: Major
                      Found in salt/modules/systemd_service.py - About 2 days to fix

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

                        def managed(name, ppa=None, **kwargs):
                            '''
                            This state manages software package repositories. Currently, :mod:`yum
                            <salt.modules.yumpkg>`, :mod:`apt <salt.modules.aptpkg>`, and :mod:`zypper
                            <salt.modules.zypper>` repositories are supported.
                        Severity: Minor
                        Found in salt/states/pkgrepo.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 detached has a Cognitive Complexity of 130 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def detached(name,
                                   rev,
                                   target=None,
                                   remote='origin',
                                   user=None,
                        Severity: Minor
                        Found in salt/states/git.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 _parse_settings_eth has a Cognitive Complexity of 130 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _parse_settings_eth(opts, iface_type, enabled, iface):
                            '''
                            Filters given options and outputs valid settings for a
                            network interface.
                            '''
                        Severity: Minor
                        Found in salt/modules/rh_ip.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 129 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def present(name, bridge, tunnel_type=None, id=None, remote=None, dst_port=None, internal=False):
                            '''
                            Ensures that the named port exists on bridge, eventually creates it.
                        
                            Args:
                        Severity: Minor
                        Found in salt/states/openvswitch_port.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 zone.py has 1031 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Management of Solaris Zones
                        
                        :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
                        Severity: Major
                        Found in salt/states/zone.py - About 2 days to fix

                          File capirca_acl.py has 1026 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Capirca ACL
                          ===========
                          
                          
                          Severity: Major
                          Found in salt/modules/capirca_acl.py - About 2 days to fix

                            Function get_iter_returns has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def get_iter_returns(
                                        self,
                                        jid,
                                        minions,
                                        timeout=None,
                            Severity: Minor
                            Found in salt/client/__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