saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function findarp has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def findarp(device=None,
            interface=None,
            mac=None,
            ip=None,
            display=_DEFAULT_DISPLAY):  # pylint: disable=invalid-name
Severity: Minor
Found in salt/runners/net.py - About 2 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 query has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def query(host=None, quiet=False):
    '''
    Query the virtual machines. When called without options all hosts
    are detected and a full query is returned. A single host can be
    passed in to specify an individual host to query.
Severity: Minor
Found in salt/runners/virt.py - About 2 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 _process_stack_cfg has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def _process_stack_cfg(cfg, stack, minion_id, pillar, namespace, config):
    basedir, filename = os.path.split(cfg)
    lookup = TemplateLookup(directories=[basedir])
    data = lookup.get_template(filename).render(__opts__=__opts__, __salt__=__salt__,
            __grains__=__grains__, minion_id=minion_id, pillar=pillar, stack=stack)
Severity: Minor
Found in salt/pillar/makostack.py - About 2 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 ext_pillar has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def ext_pillar(minion_id,
               pillar,  # pylint: disable=W0613
               conf):
    '''
    Check consul for all data
Severity: Minor
Found in salt/pillar/consul_pillar.py - About 2 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 _linux_gpu_data has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def _linux_gpu_data():
    '''
    num_gpus: int
    gpus:
      - vendor: nvidia|amd|ati|...
Severity: Minor
Found in salt/grains/core.py - About 2 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 __gather_minions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def __gather_minions(self):
        '''
        Return a list of minions to use for the batch run
        '''
        args = [self.opts['tgt'],
Severity: Minor
Found in salt/cli/batch.py - About 2 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 lock has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def lock(remote=None):
    '''
    Place an update.lk

    ``remote`` can either be a dictionary containing repo configuration
Severity: Minor
Found in salt/fileserver/svnfs.py - About 2 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 generate_mtime_map has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def generate_mtime_map(opts, path_map):
    '''
    Generate a dict of filename -> mtime
    '''
    file_map = {}
Severity: Minor
Found in salt/fileserver/__init__.py - About 2 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 lock has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def lock(remote=None):
    '''
    Place an update.lk

    ``remote`` can either be a dictionary containing repo configuration
Severity: Minor
Found in salt/fileserver/hgfs.py - About 2 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 vmctl.py has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage vms running on the OpenBSD VMM hypervisor using vmctl(8).

.. versionadded:: 2019.2.0
Severity: Minor
Found in salt/modules/vmctl.py - About 2 hrs to fix

    File aixpkg.py has 281 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Package support for AIX
    
    .. important::
    Severity: Minor
    Found in salt/modules/aixpkg.py - About 2 hrs to fix

      File nxos_upgrade.py has 281 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/modules/nxos_upgrade.py - About 2 hrs to fix

        Function done has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function done( status, nativeStatusText, responses, headers ) {
                    var isSuccess, success, error, response, modified,
                        statusText = nativeStatusText;
        
                    // Called once
        Severity: Major
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 2 hrs to fix

          File smartos_vmadm.py has 280 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Runner for SmartOS minions control vmadm
          '''
          # Import python libs
          Severity: Minor
          Found in salt/runners/smartos_vmadm.py - About 2 hrs to fix

            File win_servermanager.py has 279 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage Windows features via the ServerManager powershell module. Can list
            available and installed roles/features. Can install and remove roles/features.
            
            
            Severity: Minor
            Found in salt/modules/win_servermanager.py - About 2 hrs to fix

              File napalm_formula.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              NAPALM Formula helpers
              ======================
              
              
              Severity: Minor
              Found in salt/modules/napalm_formula.py - About 2 hrs to fix

                File openbsdpkg.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Package support for OpenBSD
                
                .. note::
                Severity: Minor
                Found in salt/modules/openbsdpkg.py - About 2 hrs to fix

                  File boto_dynamodb.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Connection module for Amazon DynamoDB
                  
                  .. versionadded:: 2015.5.0
                  Severity: Minor
                  Found in salt/modules/boto_dynamodb.py - About 2 hrs to fix

                    File asam.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Novell ASAM Runner
                    ==================
                    
                    
                    Severity: Minor
                    Found in salt/runners/asam.py - About 2 hrs to fix

                      AESFuncs has 24 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class AESFuncs(object):
                          '''
                          Set up functions that are available when the load is encrypted with AES
                          '''
                          # The AES Functions:
                      Severity: Minor
                      Found in salt/master.py - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language