saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function _parse_text_config has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_text_config(config_lines,
                       with_tags=False,
                       current_indent=0,
                       nested=False):
    struct_cfg = OrderedDict()
Severity: Minor
Found in salt/modules/iosconfig.py - About 3 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 _has_loop has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def _has_loop(self, dmap, seen=None, val=None):
        if seen is None:
            for values in six.itervalues(dmap['create']):
                seen = []
                try:
Severity: Minor
Found in salt/cloud/__init__.py - About 3 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 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def create(self, vm_, local_master=True):
        '''
        Create a single VM
        '''
        output = {}
Severity: Minor
Found in salt/cloud/__init__.py - About 3 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 show_pricing has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def show_pricing(kwargs=None, call=None):
    '''
    Show pricing for a particular profile. This is only an estimate, based on
    unofficial pricing sources.

Severity: Minor
Found in salt/cloud/clouds/ec2.py - About 3 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_nodes has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def list_nodes(full=False, call=None):
    '''
    list of nodes, keeping only a brief listing

    CLI Example:
Severity: Minor
Found in salt/cloud/clouds/joyent.py - About 3 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 nodes has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def nodes(verbose=False):
    '''
    List all compute nodes

    verbose : boolean
Severity: Minor
Found in salt/runners/smartos_vmadm.py - About 3 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 active has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def active(display_progress=False):
    '''
    Return a report on all actively running jobs from a job id centric
    perspective

Severity: Minor
Found in salt/runners/jobs.py - About 3 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 _run_check_onlyif has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def _run_check_onlyif(self, low_data, cmd_opts):
        '''
        Check that unless doesn't return 0, and that onlyif returns a 0.
        '''
        ret = {'result': False}
Severity: Minor
Found in salt/state.py - About 3 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_pillar has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def render_pillar(self, matches, errors=None):
        '''
        Extract the sls pillar files from the matches and render them into the
        pillar
        '''
Severity: Minor
Found in salt/pillar/__init__.py - About 3 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 filetree has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def filetree(collector, *paths):
    '''
    Add all files in the tree. If the "path" is a file,
    only that file will be added.

Severity: Minor
Found in salt/cli/support/intfunc.py - About 3 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 is_profile_configured has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def is_profile_configured(opts, provider, profile_name, vm_=None):
    '''
    Check if the requested profile contains the minimum required parameters for
    a profile.

Severity: Minor
Found in salt/config/__init__.py - About 3 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 _find_dirs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def _find_dirs(metadata):
    '''
    Looks for all the directories in the S3 bucket cache metadata.

    Supports trailing '/' keys (as created by S3 console) as well as
Severity: Minor
Found in salt/fileserver/s3fs.py - About 3 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 user.py has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Functions for querying and modifying a user account and the groups to which it
belongs.
'''
Severity: Minor
Found in salt/utils/user.py - About 3 hrs to fix

    File napalm.py has 302 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    NAPALM Grains
    =============
    
    
    Severity: Minor
    Found in salt/grains/napalm.py - About 3 hrs to fix

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

      # -*- coding: utf-8 -*-
      '''
      Management of the Salt scheduler
      ==============================================
      
      
      Severity: Minor
      Found in salt/states/schedule.py - About 3 hrs to fix

        File nxos.py has 301 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        State module for Cisco NX-OS Switch Proxy and Native minions
        
        .. versionadded: 2016.11.0
        Severity: Minor
        Found in salt/states/nxos.py - About 3 hrs to fix

          File supervisord.py has 301 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Interaction with the Supervisor daemon
          ======================================
          
          
          Severity: Minor
          Found in salt/states/supervisord.py - About 3 hrs to fix

            File napalm_syslog.py has 300 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            NAPALM syslog engine
            ====================
            
            
            Severity: Minor
            Found in salt/engines/napalm_syslog.py - About 3 hrs to fix

              File saltnado_websockets.py has 300 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # encoding: utf-8
              '''
              A Websockets add-on to saltnado
              ===============================
              
              
              Severity: Minor
              Found in salt/netapi/rest_tornado/saltnado_websockets.py - About 3 hrs to fix

                File table_out.py has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Display output in a table format
                =================================
                
                
                Severity: Minor
                Found in salt/output/table_out.py - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language