CiscoUcs/imcsdk

View on GitHub

Showing 440 of 1,826 total issues

Function ip_filtering_exists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def ip_filtering_exists(handle, **kwargs):
    """
    Checks if IP filtering settings match according to the parameters specified.

    Args:
Severity: Minor
Found in imcsdk/apis/admin/ip.py - About 25 mins to fix

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 vd_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def vd_update(handle,
            controller_type,
            controller_slot,
            id,
            server_id=1,
Severity: Minor
Found in imcsdk/apis/v2/storage/vd.py - About 25 mins to fix

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_bootable_slot_vnicname has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _get_bootable_slot_vnicname(handle):
    # get all the end point vnics
    vnics = handle.query_classid(class_id="AdaptorHostEthIf")
    if vnics is None:
        vnics = []
Severity: Minor
Found in imcsdk/apis/v2/server/pxe.py - About 25 mins to fix

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 _check_ntp_server_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_ntp_server_match(ntp_mo, mo):
    for prop in _NTP_SERVER_LIST:
        configured_value = getattr(ntp_mo, prop)
        in_value = getattr(mo, prop)

Severity: Minor
Found in imcsdk/apis/admin/ntp.py - About 25 mins to fix

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 vmedia_mount_remove_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def vmedia_mount_remove_all(handle, volumes= None, server_id=1):
    """
    This method will remove all the mapped vmedia mappings and saved vmedia mappings with the specified volumes

    Args:
Severity: Minor
Found in imcsdk/apis/v2/server/vmedia.py - About 25 mins to fix

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 boot_order_precision_get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def boot_order_precision_get(handle, dump=False, server_id=1):
    """
    Gets the precision boot order.
    This is supported from EP release onwards only

Severity: Minor
Found in imcsdk/apis/v2/server/boot.py - About 25 mins to fix

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 _check_ip_filter_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_ip_filter_match(ip_mo, mo):
    for prop in _IP_FILTER_LIST:
        configured_value = getattr(ip_mo, prop)
        in_value = getattr(mo, prop)
        if _is_invalid_value(configured_value) and \
Severity: Minor
Found in imcsdk/apis/admin/ip.py - About 25 mins to fix

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 __str__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        ts = 8
        if isinstance(self, GenericMo):
            out_str = "\n"
            out_str += 'GenericMo'.ljust(ts * 4) + ':' + str(
Severity: Minor
Found in imcsdk/imcmo.py - About 25 mins to fix

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 ip_filtering_exists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def ip_filtering_exists(handle, **kwargs):
    """
    Checks if IP filtering settings match according to the parameters specified.

    Args:
Severity: Minor
Found in imcsdk/apis/v2/admin/ip.py - About 25 mins to fix

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 _login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _login(self, auto_refresh=None, force=None, timeout=None):
        """
        Internal method responsible to do a login on imc server.

        Args:
Severity: Minor
Found in imcsdk/imcsession.py - About 25 mins to fix

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 __str__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        """
        Method to return string representation of a managed object.
        """

Severity: Minor
Found in imcsdk/imcmo.py - About 25 mins to fix

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 _check_ip_filter_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_ip_filter_match(ip_mo, mo):
    for prop in _IP_FILTER_LIST:
        configured_value = getattr(ip_mo, prop)
        in_value = getattr(mo, prop)
        if _is_invalid_value(configured_value) and \
Severity: Minor
Found in imcsdk/apis/v2/admin/ip.py - About 25 mins to fix

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 _commit_mos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _commit_mos(self, timeout=None):
        """Method to send multiple mos in a single XML API request"""

        from .imccoreutils import ConfigConfMosConstants as Const
        mo_dict = self.__to_commit
Severity: Minor
Found in imcsdk/imchandle.py - About 25 mins to fix

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 _check_ldap_server_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_ldap_server_match(ldap_mo, ldap_servers):
    servers, ports = _prepare_ldap_servers(ldap_servers)

    for server in servers:
        if servers[server] != getattr(ldap_mo, server):
Severity: Minor
Found in imcsdk/apis/v2/admin/ldap.py - About 25 mins to fix

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_mo_meta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_mo_meta(mo, platform=None):

    if platform:
        try:
            return mo.mo_meta[platform]
Severity: Minor
Found in imcsdk/imccoreutils.py - About 25 mins to fix

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 ldap_enable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def ldap_enable(handle,
                basedn=None,
                domain=None,
                encryption=None,
                timeout=None,
Severity: Minor
Found in imcsdk/apis/v2/admin/ldap.py - About 25 mins to fix

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 _check_ntp_server_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_ntp_server_match(ntp_mo, mo):
    for prop in _NTP_SERVER_LIST:
        configured_value = getattr(ntp_mo, prop)
        in_value = getattr(mo, prop)

Severity: Minor
Found in imcsdk/apis/v2/admin/ntp.py - About 25 mins to fix

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 sync_mo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def sync_mo(self, mo):
        """
        Method to return string representation of a managed object.
        """

Severity: Minor
Found in imcsdk/imcmo.py - About 25 mins to fix

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 _commit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _commit(self, timeout=None):
        """
        Commit the buffer to the server. Pushes all the configuration changes
        so far to the server.
        Configuration could be added to the commit buffer using add_mo(),
Severity: Minor
Found in imcsdk/imchandle.py - About 25 mins to fix

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 set_attr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def set_attr(self, key, value):
        """ This method sets the attribute of external method object."""
        if key in self.__property_meta:
            self.__dict__[key] = value
        elif key == 'error_code':
Severity: Minor
Found in imcsdk/imcmethod.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language