saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File npm.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage and query NPM packages.
'''
from __future__ import absolute_import, unicode_literals, print_function
Severity: Minor
Found in salt/modules/npm.py - About 3 hrs to fix

    File wtmp.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Beacon to fire events at login of users as registered in the wtmp file
    
    .. versionadded:: 2015.5.0
    Severity: Minor
    Found in salt/beacons/wtmp.py - About 3 hrs to fix

      GitProvider has 27 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class GitProvider(object):
          '''
          Base class for gitfs/git_pillar provider classes. Should never be used
          directly.
      
      
      Severity: Minor
      Found in salt/utils/gitfs.py - About 3 hrs to fix

        File ini_manage.py has 298 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Manage ini files
        ================
        
        
        Severity: Minor
        Found in salt/states/ini_manage.py - About 3 hrs to fix

          File libcloud_storage.py has 298 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Apache Libcloud Storage Management
          ==================================
          
          
          Severity: Minor
          Found in salt/modules/libcloud_storage.py - About 3 hrs to fix

            File boto_elbv2.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage AWS Application Load Balancer
            
            .. versionadded:: 2017.7.0
            Severity: Minor
            Found in salt/states/boto_elbv2.py - About 3 hrs to fix

              File boto_cognitoidentity.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Manage CognitoIdentity Functions
              ================================
              
              
              Severity: Minor
              Found in salt/states/boto_cognitoidentity.py - About 3 hrs to fix

                File nxos_api.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Execution module to manage Cisco Nexus Switches (NX-OS) over the NX-API
                
                .. versionadded:: 2019.2.0
                Severity: Minor
                Found in salt/modules/nxos_api.py - About 3 hrs to fix

                  File haproxyconn.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Support for haproxy
                  
                  .. versionadded:: 2014.7.0
                  Severity: Minor
                  Found in salt/modules/haproxyconn.py - About 3 hrs to fix

                    File pillar_ldap.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Use LDAP data as a Pillar source
                    
                    This pillar module executes a series of LDAP searches.
                    Severity: Minor
                    Found in salt/pillar/pillar_ldap.py - About 3 hrs to fix

                      File nxos.py has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      # Copyright (c) 2018 Cisco and/or its affiliates.
                      #
                      # Licensed under the Apache License, Version 2.0 (the "License");
                      # you may not use this file except in compliance with the License.
                      Severity: Minor
                      Found in salt/utils/nxos.py - About 3 hrs to fix

                        File pdbedit.py has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Manage accounts in Samba's passdb using pdbedit
                        
                        :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
                        Severity: Minor
                        Found in salt/modules/pdbedit.py - About 3 hrs to fix

                          File saltsupport.py has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          #
                          # Author: Bo Maryniuk <bo@suse.de>
                          #
                          # Copyright 2018 SUSE LLC
                          Severity: Minor
                          Found in salt/modules/saltsupport.py - About 3 hrs to fix

                            Function get_esky_freezer_includes has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def get_esky_freezer_includes(self):
                                    # Sometimes the auto module traversal doesn't find everything, so we
                                    # explicitly add it. The auto dependency tracking especially does not work for
                                    # imports occurring in salt.modules, as they are loaded at salt runtime.
                                    # Specifying includes that don't exist doesn't appear to cause a freezing
                            Severity: Minor
                            Found in setup.py - About 3 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 cache_dir has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def cache_dir(self, path, saltenv='base', include_empty=False,
                                              include_pat=None, exclude_pat=None, cachedir=None):
                                    '''
                                    Download all of the files in a subdir of the master
                                    '''
                            Severity: Minor
                            Found in salt/fileclient.py - About 3 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 extract_masters has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def extract_masters(opts, masters='master', port=None, raise_if_empty=True):
                                '''
                                Parses opts and generates a list of master (host,port) addresses.
                                By default looks for list of masters in opts['master'] and uses
                                opts['master_port'] as the default port when otherwise not provided.
                            Severity: Minor
                            Found in salt/daemons/__init__.py - About 3 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 lsa_logon_user has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def lsa_logon_user(auth_info, local_groups=None, origin_name=py_origin_name,
                                               source_context=None, auth_package=None, logon_type=None,
                                               lsa_handle=None):
                                if local_groups is None:
                                    plocal_groups = LPTOKEN_GROUPS()
                            Severity: Minor
                            Found in salt/platform/win.py - About 3 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 _uninstall has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def _uninstall(
                                action='remove',
                                name=None,
                                version=None,
                                pkgs=None,
                            Severity: Minor
                            Found in salt/states/pkg.py - About 3 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 absent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def absent(
                                    name,
                                    region=None,
                                    key=None,
                                    keyid=None,
                            Severity: Minor
                            Found in salt/states/boto_sns.py - About 3 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 thing_type_absent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def thing_type_absent(name, thingTypeName,
                                              region=None, key=None, keyid=None, profile=None):
                                '''
                                Ensure thing type with passed properties is absent.
                            
                            
                            Severity: Minor
                            Found in salt/states/boto_iot.py - About 3 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