saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function dns_exists has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def dns_exists(name, servers=None, interface='Local Area Connection', replace=False):
    '''
    Configure the DNS server list in the specified interface

    Example:
Severity: Minor
Found in salt/states/win_dns_client.py - About 7 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 init_remotes has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    def init_remotes(self, remotes, per_remote_overrides=(),
                     per_remote_only=PER_REMOTE_ONLY,
                     global_only=GLOBAL_ONLY):
        '''
        Initialize remotes
Severity: Minor
Found in salt/utils/gitfs.py - About 7 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 edit_conf has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def edit_conf(conf_file,
              out_format='simple',
              read_only=False,
              lxc_config=None,
              **kwargs):
Severity: Minor
Found in salt/modules/lxc.py - About 7 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 update_lxc_conf has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None):
    '''
    Edit LXC configuration options

    path
Severity: Minor
Found in salt/modules/lxc.py - About 7 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 export has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def export(name,
           path,
           overwrite=False,
           makedirs=False,
           compression=None,
Severity: Minor
Found in salt/modules/dockermod.py - About 7 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 set_automaster has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def set_automaster(
        name,
        device,
        fstype,
        opts='',
Severity: Minor
Found in salt/modules/mount.py - About 7 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 add has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def add(path, index=None, **kwargs):
    '''
    Add the directory to the SYSTEM path in the index location. Returns
    ``True`` if successful, otherwise ``False``.

Severity: Minor
Found in salt/modules/win_path.py - About 7 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 install has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def install(name=None,
            refresh=False,
            fromrepo=None,
            pkgs=None,
            sources=None,
Severity: Minor
Found in salt/modules/zypperpkg.py - About 7 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 _format_instance_info has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def _format_instance_info(vm):
    device_full_info = {}
    device_mac_addresses = []
    if "config.hardware.device" in vm:
        for device in vm["config.hardware.device"]:
Severity: Minor
Found in salt/cloud/clouds/vmware.py - About 7 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 get_cloud_config_value has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):
    '''
    Search and return a setting in a known order:

        1. In the virtual machine's configuration
Severity: Minor
Found in salt/config/__init__.py - About 7 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 beacon has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def beacon(config):
    '''
    Emit the status of all devices returned by adb

    Specify the device states that should emit an event,
Severity: Minor
Found in salt/beacons/adb.py - About 7 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 beacon has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def beacon(config):
    '''
    Broadcast values via zeroconf

    If the announced values are static, it is advised to set run_once: True
Severity: Minor
Found in salt/beacons/bonjour_announce.py - About 7 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

File aws.py has 468 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Connection library for AWS

.. versionadded:: 2015.5.0
Severity: Minor
Found in salt/utils/aws.py - About 7 hrs to fix

    File args.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Functions used for CLI argument handling
    '''
    
    
    Severity: Minor
    Found in salt/utils/args.py - About 7 hrs to fix

      File ipset.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Support for ipset
      '''
      
      
      Severity: Minor
      Found in salt/modules/ipset.py - About 7 hrs to fix

        File parallels.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Parallels Cloud Module
        ======================
        
        
        Severity: Minor
        Found in salt/cloud/clouds/parallels.py - About 7 hrs to fix

          File nftables.py has 466 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Management of nftables
          ======================
          
          
          Severity: Minor
          Found in salt/states/nftables.py - About 7 hrs to fix

            File mysql.py has 465 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Return data to a mysql server
            
            :maintainer:    Dave Boucha <dave@saltstack.com>, Seth House <shouse@saltstack.com>
            Severity: Minor
            Found in salt/returners/mysql.py - About 7 hrs to fix

              File infoblox.py has 464 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              This module have been tested on infoblox API v1.2.1,
              other versions of the API are likly workable.
              
              
              Severity: Minor
              Found in salt/modules/infoblox.py - About 7 hrs to fix

                File rh_service.py has 463 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Service support for RHEL-based systems, including support for both upstart and sysvinit
                
                .. important::
                Severity: Minor
                Found in salt/modules/rh_service.py - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language