saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

# -*- coding: utf-8 -*-
'''
Render the pillar data
'''

Severity: Major
Found in salt/pillar/__init__.py - About 2 days to fix

    Function _parse_interfaces has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
    Open

    def _parse_interfaces(interface_files=None):
        '''
        Parse /etc/network/interfaces and return current configured interfaces
        '''
        if interface_files is None:
    Severity: Minor
    Found in salt/modules/debian_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

    File win.py has 1017 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    # Copyright 2017 Damon Atkins
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    Severity: Major
    Found in salt/utils/pkg/win.py - About 2 days to fix

      File rh_ip.py has 1013 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      The networking module for RHEL/Fedora based distros
      '''
      from __future__ import absolute_import, unicode_literals, print_function
      Severity: Major
      Found in salt/modules/rh_ip.py - About 2 days to fix

        Function present has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(
                name,
                launch_config_name,
                availability_zones,
                min_size,
        Severity: Minor
        Found in salt/states/boto_asg.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 _get_reg_software has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
        Open

        def _get_reg_software(include_components=True,
                              include_updates=True):
            '''
            This searches the uninstall keys in the registry to find a match in the sub
            keys, it will return a dict with the display name as the key and the
        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

        Function render_state has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
        Open

            def render_state(self, sls, saltenv, mods, matches, local=False):
                '''
                Render a state file and retrieve all of the include states
                '''
                errors = []
        Severity: Minor
        Found in salt/state.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 dns.py has 1004 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Compendium of generic DNS utilities
        # Examples:
        dns.lookup(name, rdtype, ...)
        Severity: Major
        Found in salt/utils/dns.py - About 2 days to fix

          File kickstart.py has 1003 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Utilities for managing kickstart
          
          .. versionadded:: Beryllium
          Severity: Major
          Found in salt/utils/kickstart.py - About 2 days to fix

            File gpg.py has 1001 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
            Sign, encrypt and sign plus encrypt text and files.
            
            
            Severity: Major
            Found in salt/modules/gpg.py - About 2 days to fix

              File proxmox.py has 992 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                File boto_cloudfront.py has 984 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Manage CloudFront distributions
                
                .. versionadded:: 2018.3.0
                Severity: Major
                Found in salt/states/boto_cloudfront.py - About 2 days to fix

                  Function neighbors has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def neighbors(*asns, **kwargs):
                      '''
                      Search for BGP neighbors details in the mines of the ``bgp.neighbors`` function.
                  
                      Arguments:
                  Severity: Minor
                  Found in salt/runners/bgp.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 purefa.py has 979 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  
                  ##
                  # Copyright 2017 Pure Storage Inc
                  #
                  Severity: Major
                  Found in salt/modules/purefa.py - About 2 days to fix

                    Function _auth has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _auth(self, load):
                            '''
                            Authenticate the client, use the sent public key to encrypt the AES key
                            which was generated at start up.
                    
                    
                    Severity: Minor
                    Found in salt/transport/mixins/auth.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 hosted_zone_present has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def hosted_zone_present(name, Name=None, PrivateZone=False,
                                            CallerReference=None, Comment=None, VPCs=None,
                                            region=None, key=None, keyid=None, profile=None):
                        '''
                        Ensure a hosted zone exists with the given attributes.
                    Severity: Minor
                    Found in salt/states/boto3_route53.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 profitbricks.py has 975 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File minions.py has 971 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      This module contains routines used to verify the matcher against the minions
                      expected to return
                      '''
                      Severity: Major
                      Found in salt/utils/minions.py - About 2 days to fix

                        File schedule.py has 970 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Module for managing the Salt schedule on a minion
                        
                        .. versionadded:: 2014.7.0
                        Severity: Major
                        Found in salt/modules/schedule.py - About 2 days to fix

                          File setup.py has 963 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          #!/usr/bin/env python
                          # -*- coding: utf-8 -*-
                          '''
                          The setup script for salt
                          '''
                          Severity: Major
                          Found in setup.py - About 2 days to fix
                            Severity
                            Category
                            Status
                            Source
                            Language