Showing 440 of 1,826 total issues
Function __dequeue_function
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def __dequeue_function(self):
"""
Internal method to dequeue to events.
"""
- 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"
Further reading
File certificate.py
has 366 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
File certificate.py
has 366 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 _get_inventory
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def _get_inventory(handle, comp, spec, inventory):
component = spec[comp]
class_id = component["class_id"]
mos = handle.query_classid(class_id)
- 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
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def _get_inventory(handle, comp, spec, inventory):
component = spec[comp]
class_id = component["class_id"]
mos = handle.query_classid(class_id)
- 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 from_xml
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def from_xml(self, elem, handle=None):
"""
Method updates the object from 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
Function from_xml
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def from_xml(self, elem, handle=None):
"""Method updates/fills the object from the xml representation
of the external method object. """
self._handle = handle
- 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 inventory.py
has 352 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
File boot.py
has 352 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
File inventory.py
has 352 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
File imcgenutils.py
has 341 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
Function _enable_pxe_boot_mac
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _enable_pxe_boot_mac(handle, mac_address_map, ep_mac_map):
# if pxe device mac address matches endpoint vnic
# then enable pxe boot for resp vnic
log.debug("enabling pxe boot on vnics using mac address")
- 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 vmedia.py
has 334 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
File StorageControllerProps.py
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""This module contains the general information for StorageControllerProps ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
Function _create_vic_object
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _create_vic_object(adaptor_mo, vic_name, vic_type, api_error_msg,
**kwargs):
from imcsdk.imccoreutils import load_class
from imcsdk.imccoreutils import find_class_id_in_mo_meta_ignore_case
- 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 MemoryPersistentMemoryUnit.py
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""This module contains the general information for MemoryPersistentMemoryUnit ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
File MgmtIf.py
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""This module contains the general information for MgmtIf ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
File snmp.py
has 320 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 extract_molist_from_method_response
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def extract_molist_from_method_response(method_response,
in_hierarchical=False):
"""
Methods extracts mo list from response received from imc server i.e.
external method 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"