Showing 9,400 of 17,590 total issues
Function sls_id
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sls_id(id_, mods, test=None, queue=False, **kwargs):
'''
Call a single ID from the named module(s) and handle all requisites
The state ID comes *before* the module ID(s) on the command line.
Function restartcheck
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def restartcheck(ignorelist=None, blacklist=None, excludepid=None, **kwargs):
'''
Analyzes files openeded by running processes and seeks for packages which need to be restarted.
Args:
Function show_pricing
has 26 lines of code (exceeds 25 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.
Function request_instance
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_instance(vm_=None, call=None):
'''
Put together all of the information necessary to request an instance
through Novaclient and then fire off the request the instance.
Function create_network_interface
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_network_interface(call=None, kwargs=None):
'''
Create a network interface.
'''
if call != 'action':
Function gen_csr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gen_csr(
minion_id,
dns_name,
zone='default',
country=None,
Function apply_minion_config
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_minion_config(overrides=None,
defaults=None,
cache_minion_id=False,
minion_id=None):
'''
Consider simplifying this complex logical expression. Open
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
Consider simplifying this complex logical expression. Open
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 1;
Consider simplifying this complex logical expression. Open
if version and version in cver \
and not reinstall \
and not pkg_verify:
# The package is installed and is the correct version
return {'name': name,
Consider simplifying this complex logical expression. Open
if not cleanup_temp and (not exists or (exists and start)) \
or (start and cleanup_temp and pre_state != 'running'):
if __opts__['test']:
ret['result'] = None
comments.append('Container would be started')
Consider simplifying this complex logical expression. Open
if ((ip or netmask or gateway) and not dhcp and (ip != current_nic['Network']['IP Address'] or
netmask != current_nic['Network']['Subnet Mask'] or
gateway != current_nic['Network']['Gateway'])):
ret['changes'].update({'IP': {'Old': current_nic['Network'],
'New': {'IP Address': ip,
Consider simplifying this complex logical expression. Open
if (salt.utils.platform.is_windows() and
user_to_uid(user) != user_to_uid(
get_user(name, follow_symlinks=follow_symlinks)) and
user != ''
) or (
Consider simplifying this complex logical expression. Open
if (salt.utils.platform.is_windows() and
group_to_gid(group) != group_to_gid(
get_group(name, follow_symlinks=follow_symlinks)) and
user != '') or (
not salt.utils.platform.is_windows() and
Consider simplifying this complex logical expression. Open
if template_hash and isinstance(template_hash, six.string_types) and not\
(template_hash.startswith('salt://') or template_hash.startswith('file://')):
# If the template hash is passed as string, and it's not a file
# (starts with the salt:// or file:// URI), then make it a list
# of 1 element (for the iteration below)
Consider simplifying this complex logical expression. Open
if vm_name not in names:
continue
elif driver == 'ec2' and 'aws' in handled_drivers and \
'aws' in matches[handled_drivers['aws']] and \
Consider simplifying this complex logical expression. Open
if self.selected_query_option is not None:
if self.selected_query_option == 'list_providers':
try:
ret = mapper.provider_list()
except (SaltCloudException, Exception) as exc:
Function factory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def factory(cls, opts, **kwargs):
# Default to ZeroMQ for now
ttype = 'zeromq'
# determine the ttype
- 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 main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
target = ''
search = os.path.dirname(sys.executable)
replace = '..'
try:
- 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 connect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def connect(self):
try:
self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self.io_loop)
self.tok = self.auth.gen_token(b'salt')
if not self.auth.authenticated:
- 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"