Showing 9,400 of 17,590 total issues
File lxd_container.py
has 694 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Manage LXD containers.
.. versionadded:: 2019.2.0
File xapi_virt.py
has 692 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
This module (mostly) uses the XenAPI to manage Xen virtual machines.
Big fat warning: the XenAPI used in this file is the one bundled with
File ipmi.py
has 691 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Support IPMI commands over LAN. This module does not talk to the local
systems hardware through IPMI drivers. It uses a python module `pyghmi`.
Function install
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def install(name=None,
refresh=False,
pkgs=None,
sources=None,
slot=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 load_template
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def load_template(template_name=None,
template_source=None,
context=None,
defaults=None,
template_engine='jinja',
- 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 _result_to_dict
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def _result_to_dict(data, result, conf, source):
'''
Aggregates LDAP search result based on rules, returns a dictionary.
Rules:
- 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
File win_dacl.py
has 688 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Manage DACLs on Windows
:depends: - winreg Python module
File snapper.py
has 687 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Module to manage filesystem snapshots with snapper
.. versionadded:: 2016.11.0
File cp.py
has 686 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Minion side functions for salt-cp
'''
Function _routes_present
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def _routes_present(route_table_name, routes, tags=None, region=None, key=None, keyid=None, profile=None):
ret = {'name': route_table_name,
'result': True,
'comment': '',
'changes': {}
- 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 get
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def get(policy_class=None, return_full_policy_names=True,
hierarchical_return=False, adml_language='en-US',
return_not_configured=False):
'''
Get a policy value
- 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 create
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def create(vm_=None, call=None):
'''
Create a single VM from a data dict
'''
if call:
- 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
File slack.py
has 682 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
An engine that reads messages from Slack and can act on them
.. versionadded: 2016.3.0
File cron.py
has 678 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Work with cron
.. note::
Function present
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def present(name,
password=None,
force=False,
tags=None,
perms=(),
- 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 pg_update
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def pg_update(name, hostgroup=None, host=None, volume=None):
'''
Update a protection group on a Pure Storage FlashArray.
- 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 show_config
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def show_config(jail):
'''
Display specified jail's configuration
CLI Example:
- 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
File boto3_route53.py
has 674 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
Manage Route53 records with Boto 3
.. versionadded:: 2017.7.0
ThreadLocalProxy
has 81 functions (exceeds 20 allowed). Consider refactoring. Open
class ThreadLocalProxy(object):
'''
Proxy that delegates all operations to its referenced object. The referenced
object is hold through a thread-local variable, so that this proxy may refer
to different objects in different threads of execution.
File manage.py
has 671 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
'''
General management functions for salt, tools like seeing what hosts are up
and what hosts are down
'''