saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function create_extension has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def create_extension(name,
                     if_not_exists=None,
                     schema=None,
                     ext_version=None,
                     from_version=None,
Severity: Minor
Found in salt/modules/postgres.py - About 4 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_upgrade has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_upgrade(stdout):
    '''
    Parse the output from the ``pkg upgrade --dry-run`` command

    Returns a dictionary of the expected actions:
Severity: Minor
Found in salt/modules/pkgng.py - About 4 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 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def merge(value,
          default='',
          omit_opts=False,
          omit_master=False,
          omit_pillar=False):
Severity: Minor
Found in salt/modules/config.py - About 4 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 config_set has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def config_set(key,
               value=None,
               multivar=None,
               cwd=None,
               user=None,
Severity: Minor
Found in salt/modules/git.py - About 4 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 list_repo_pkgs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def list_repo_pkgs(*args, **kwargs):
    '''
    .. versionadded:: 2017.7.5,2018.3.1

    Returns all available packages. Optionally, package names (and name globs)
Severity: Minor
Found in salt/modules/zypperpkg.py - About 4 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 _render_tab has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def _render_tab(lst):
    '''
    Takes a tab list structure and renders it to a list for applying it to
    a file
    '''
Severity: Minor
Found in salt/modules/cron.py - About 4 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 render_template has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    def render_template(self, high, template):
        errors = []
        if not high:
            return high, errors

Severity: Minor
Found in salt/state.py - About 4 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 output has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    Display output for the salt-run virt.query function
    '''
    out = ''
Severity: Minor
Found in salt/output/virt_query.py - About 4 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 display has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    def display(self,
                ret,
                indent,
                out,
                rows_key=None,
Severity: Minor
Found in salt/output/table_out.py - About 4 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 textfsm_mod.py has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
TextFSM
=======

Severity: Minor
Found in salt/modules/textfsm_mod.py - About 4 hrs to fix

    File boto_kinesis.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Manage Kinesis Streams
    ======================
    
    
    Severity: Minor
    Found in salt/states/boto_kinesis.py - About 4 hrs to fix

      File mac_brew_pkg.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Homebrew for macOS
      
      .. important::
      Severity: Minor
      Found in salt/modules/mac_brew_pkg.py - About 4 hrs to fix

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

        # -*- coding: utf-8 -*-
        '''
        Edit ini files
        
        :maintainer: <akilesh1597@gmail.com>
        Severity: Minor
        Found in salt/modules/ini_manage.py - About 4 hrs to fix

          File win_pki.py has 369 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Microsoft certificate management via the PKI Client PowerShell module.
          https://technet.microsoft.com/en-us/itpro/powershell/windows/pkiclient/pkiclient
          
          
          Severity: Minor
          Found in salt/modules/win_pki.py - About 4 hrs to fix

            File jboss7.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Module for managing JBoss AS 7 through the CLI interface.
            
            .. versionadded:: 2015.5.0
            Severity: Minor
            Found in salt/modules/jboss7.py - About 4 hrs to fix

              Function support has 119 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jQuery.support = (function() {
              
                  var support, all, a,
                      input, select, fragment,
                      opt, eventName, isSupported, i,
              Severity: Major
              Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 4 hrs to fix

                File scaleway.py has 365 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Function dumps has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def dumps(self, msg, use_bin_type=False):
                          '''
                          Run the correct dumps serialization format
                  
                          :param use_bin_type: Useful for Python 3 support. Tells msgpack to
                  Severity: Minor
                  Found in salt/payload.py - About 4 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 _publish_daemon has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _publish_daemon(self, log_queue=None):
                          '''
                          Bind to the interface specified in the configuration file
                          '''
                          salt.utils.process.appendproctitle(self.__class__.__name__)
                  Severity: Minor
                  Found in salt/transport/zeromq.py - About 4 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 list_present has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM):
                      '''
                      .. versionadded:: 2014.1.0
                  
                      Ensure the value is present in the list-type grain. Note: If the grain that is
                  Severity: Minor
                  Found in salt/states/grains.py - About 4 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