Showing 178 of 492 total issues
File converttopython.py
has 1202 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
Function _get_transaction_impact
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
def _get_transaction_impact(self, rsp):
"""
Outputs a json object, that can have the following keys,
"failure", "warning", "reboot_user_ack", "reboot_immediate",
"reboot_maintenance", "misc"
- 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 ucshandle.py
has 812 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 ucs_kvm_launch
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
def ucs_kvm_launch(handle, service_profile=None, blade=None, rack_unit=None,
frame_title=None, need_url=False):
"""
ucs_kvm_launch launches the kvm session for a specified server.
- 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 ucsmo.py
has 550 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 prop
File ucssession.py
has 531 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 ucscoreutils.py
has 518 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 prop
File ucseventhandler.py
has 500 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
File ucstechsupport.py
has 459 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
UcsSession
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class UcsSession(object):
"""
UcsSession class is session interface for any Ucs related communication.
Parent class of UcsHandle, used internally by UcsHandle class.
"""
Function sync_ucs_mo
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def sync_ucs_mo(ref_handle, difference,
delete_not_present=False,
version_filter=True):
"""
syncs the difference object on reference ucsm.
- 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_ucs_cco_image_list
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def get_ucs_cco_image_list(username=None, password=None, mdf_id_list=None,
proxy=None):
"""
Gets the list of images available on CCO
- 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 _generate_config_resolve_cmdlet
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def _generate_config_resolve_cmdlet(xml_string, method):
"""
Internal method which takes xmlstring, and generate script for
configResolveDn, configResolveDns, configResolveClass and
configResolveClasses methods.
- 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_property_map_from_node
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def _create_property_map_from_node(class_node, class_status):
gmo_flag = False
property_map = {}
if ucscoreutils.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
Function validate_property_value
has a Cognitive Complexity of 40 (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 comparesyncmo.py
has 419 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 inventory.py
has 413 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
File ucscoremeta.py
has 412 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 _generate_multiple_clone_cmdlets
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def _generate_multiple_clone_cmdlets(xml_string, is_prefix_based):
"""
Internal method which takes xmlstring, and generate script for
lsInstantiateNTemplate and lsInstantiateNNamedTemplate methods.
"""
- 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 convert_to_ucs_python
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def convert_to_ucs_python(log_path=None, xml=False, request=None,
gui_log=False, path=None, literal_path=None,
dump_to_file=False, dump_file_path=None,
dump_xml=False):
"""
- 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"