saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function set_wu_settings has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def set_wu_settings(level=None,
                    recommended=None,
                    featured=None,
                    elevated=None,
                    msupdate=None,
Severity: Minor
Found in salt/modules/win_wua.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 _parse_conf has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_conf(conf_file=None, in_mem=False, family='ipv4'):
    '''
    If a file is not passed in, and the correct one for this OS is not
    detected, return False
    '''
Severity: Minor
Found in salt/modules/iptables.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 _deleted_files has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def _deleted_files():
    '''
    Iterates over /proc/PID/maps and /proc/PID/fd links and returns list of desired deleted files.

    Returns:
Severity: Minor
Found in salt/modules/restartcheck.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 print_ has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def print_(*args, **kwargs):
        """The new-style print function for Python 2.4 and 2.5."""
        fp = kwargs.pop("file", sys.stdout)
        if fp is None:
            return
Severity: Minor
Found in salt/ext/six.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 create_node has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def create_node(vm_, newid):
    '''
    Build and submit the requestdata to create a new node
    '''
    newnode = {}
Severity: Minor
Found in salt/cloud/clouds/proxmox.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 _disbatch_local has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def _disbatch_local(self, chunk):
        '''
        Dispatch local client commands
        '''
        # Generate jid and find all minions before triggering a job to subscribe all returns from minions
Severity: Minor
Found in salt/netapi/rest_tornado/saltnado.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 _merge_tops_same has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def _merge_tops_same(self, tops):
        '''
        For each saltenv, only consider the top file from that saltenv. All
        sections matching a given saltenv, which appear in a different
        saltenv's top file, will be ignored.
Severity: Minor
Found in salt/state.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 call has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def call(self):
        '''
        Call the module
        '''
        ret = {}
Severity: Minor
Found in salt/cli/caller.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 influxdb08mod.py has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
InfluxDB - A distributed time series database

Module to provide InfluxDB compatibility to Salt (compatible with InfluxDB
Severity: Minor
Found in salt/modules/influxdb08mod.py - About 7 hrs to fix

    File vagrant.py has 474 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Work with virtual machines managed by Vagrant.
    
    .. versionadded:: 2018.3.0
    Severity: Minor
    Found in salt/modules/vagrant.py - About 7 hrs to fix

      File thread_local_proxy.py has 473 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Proxy object that can reference different values depending on the current
      thread of execution.
      
      
      Severity: Minor
      Found in salt/utils/thread_local_proxy.py - About 7 hrs to fix

        File rpmbuild_pkgbuild.py has 471 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        RPM Package builder system
        
        .. versionadded:: 2015.8.0
        Severity: Minor
        Found in salt/modules/rpmbuild_pkgbuild.py - About 7 hrs to fix

          File makostack.py has 471 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Simple and flexible YAML ext_pillar which can read pillar from within pillar.
          
          .. versionadded:: 2016.3.0
          Severity: Minor
          Found in salt/pillar/makostack.py - About 7 hrs to fix

            File highstate.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Outputter for displaying results of state runs
            ==============================================
            
            
            Severity: Minor
            Found in salt/output/highstate.py - About 7 hrs to fix

              File templates.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Template render systems
              '''
              
              
              Severity: Minor
              Found in salt/utils/templates.py - About 7 hrs to fix

                File test.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Module for running arbitrary tests
                '''
                from __future__ import absolute_import, print_function, unicode_literals
                Severity: Minor
                Found in salt/modules/test.py - About 7 hrs to fix

                  File boto_kms.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Connection module for Amazon KMS
                  
                  .. versionadded:: 2015.8.0
                  Severity: Minor
                  Found in salt/modules/boto_kms.py - About 7 hrs to fix

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

                    def options_absent(name, sections=None, separator='='):
                        '''
                        .. code-block:: yaml
                    
                            /home/saltminion/api-paste.ini:
                    Severity: Minor
                    Found in salt/states/ini_manage.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 present has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def present(name,
                                keys=None,
                                user=None,
                                keyserver=None,
                                gnupghome=None,
                    Severity: Minor
                    Found in salt/states/gpg.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 cloned has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def cloned(name,
                               target=None,
                               branch=None,
                               user=None,
                               password=None,
                    Severity: Minor
                    Found in salt/states/git.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

                    Severity
                    Category
                    Status
                    Source
                    Language