Showing 440 of 1,826 total issues
File user.py
has 496 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function __init__
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent_mo_or_dn, **kwargs):
self._dirty_mask = 0
self.status = None
self.vp_slot10_link_speed = None
self.vp_slot10_state = None
File boot.py
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function to_xml
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def to_xml(self, xml_doc=None, option=None, elem_name=None, cookie=None):
"""
Method writes the xml representation of the managed object.
"""
- 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 imccoremeta.py
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
File imceventhandler.py
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2013 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
ImcSession
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
class ImcSession(object):
"""
ImcSession class is session interface for any Imc related communication.
Parent class of ImcHandle, used internally by ImcHandle class.
"""
File vmedia.py
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function validate_property_value
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def validate_property_value(self, input_value):
"""validate property value of mo."""
error_msg = None
if input_value is 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
File ldap.py
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function vmedia_mount_create_all
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def vmedia_mount_create_all(handle, mappings = None, server_id=1, timeout=60):
"""
This method will make one request to create all the vmedia mappings
Args:
handle (ImcHandle)
- 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 controller.py
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2017 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function bios_tokens_set
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def bios_tokens_set(handle, tokens={}, server_id=1):
"""
Args:
handle (ImcHandle)
tokens (dictionary) : (key, value) pair of bios tokens with key being the name of the token
- 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 _sd_card_config_set_m5
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def _sd_card_config_set_m5(handle, expected_vds, existing_vds, mos_dict):
if 'OS' in expected_vds:
expected_vd = expected_vds['OS']
existing_vd = existing_vds.get('OS', 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
File bios.py
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function adaptor_set_all
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def adaptor_set_all(handle, adaptors=None, server_id=1, **kwargs):
"""
Example:
adaptor_set_all(handle,
adaptors=[
- 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 mgmt_if_configure
has 41 arguments (exceeds 4 allowed). Consider refactoring. Open
def mgmt_if_configure(handle,
Function _parse_pxe_devices
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def _parse_pxe_devices(devices):
# segregate devices on the basis of interface source
# slot_interface_map (dict)
# key: slot + "~~~" + interface_name
# value: boot device
- 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 local_users_update
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def local_users_update(handle, users=None):
"""
This method will create, modify or delete local users.
It could also be a combination of these operations.
- 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_inventory_html
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _get_inventory_html(inventory, file_name, spec=inventory_spec):
if file_name is None:
raise ImcOperationError("Inventory collection",
"file_name is a required parameter")
f = open(file_name, "w")
- 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"