Showing 9,400 of 17,590 total issues
Function create
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(vm_):
'''
Create a single VM from a data dict
'''
try:
File win_powercfg.py
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
This module allows you to control the power settings of a windows minion via
powercfg.
File pkgutil.py
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Pkgutil support for Solaris
.. important::
Consider simplifying this complex logical expression. Open
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
Consider simplifying this complex logical expression. Open
if tests or missing:
ret['comment'] = ' '.join([
missing and "Unavailable function{plr}: "
"{func}.".format(plr=(len(missing) > 1 or ''),
func=(', '.join(missing) or '')) or '',
OrderedDict
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
Inspector
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Inspector(EnvLoader):
DEFAULT_MINION_CONFIG_PATH = '/etc/salt/minion'
MODE = ['configuration', 'payload', 'all']
IGNORE_MOUNTS = ["proc", "sysfs", "devtmpfs", "tmpfs", "fuse.gvfs-fuse-daemon"]
AsyncAuth
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class AsyncAuth(object):
'''
Set up an Async object to maintain authentication with the salt master
'''
# This class is only a singleton per minion/master pair
Function init
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
File etcd_mod.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Manage etcd Keys
================
File launchctl_service.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Module for the management of MacOS systems that use launchd/launchctl
.. important::
File pkg_resource.py
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Resources needed by pkg providers
'''
Function request_instance
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_instance(vm_):
'''
Request a VM from Azure.
'''
compconn = get_conn(client_type='compute')
File fsdb.py
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Copyright 2016 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
File namecheap_domains.py
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Function _get_conn
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _get_conn(ret):
'''
Return a mongodb connection object
'''
_options = _get_options(ret)
- Read upRead up
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 __discover_version
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def __discover_version(saltstack_version):
# This might be a 'python setup.py develop' installation type. Let's
# discover the version information at runtime.
import os
import subprocess
- Read upRead up
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 uninstalled
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def uninstalled(name):
'''
Ensure zone is uninstalled
name : string
- Read upRead up
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 downloaded
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def downloaded(name,
version=None,
pkgs=None,
fromrepo=None,
ignore_epoch=None,
- Read upRead up
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 attached
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def attached(name, force=False):
'''
Ensure zone is attached
name : string
- Read upRead up
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"