CiscoUcs/imcsdk

View on GitHub

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
Severity: Minor
Found in imcsdk/apis/v2/admin/user.py - About 7 hrs to fix

    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
    Severity: Major
    Found in imcsdk/mometa/bios/BiosVfPCISlotOptionROMEnable.py - About 7 hrs to fix

      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
      Severity: Minor
      Found in imcsdk/apis/v2/server/boot.py - About 7 hrs to fix

        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.
                """
        
        
        Severity: Minor
        Found in imcsdk/imcmo.py - About 7 hrs 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

        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
        Severity: Minor
        Found in imcsdk/imccoremeta.py - About 7 hrs to fix

          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
          Severity: Minor
          Found in imcsdk/imceventhandler.py - About 7 hrs to fix

            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.
                """
            Severity: Minor
            Found in imcsdk/imcsession.py - About 7 hrs to fix

              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
              Severity: Minor
              Found in imcsdk/apis/v2/server/vmedia.py - About 7 hrs to fix

                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:
                Severity: Minor
                Found in imcsdk/imccoremeta.py - About 6 hrs 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

                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
                Severity: Minor
                Found in imcsdk/apis/admin/ldap.py - About 6 hrs to fix

                  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)
                  Severity: Minor
                  Found in imcsdk/apis/v2/server/vmedia.py - About 6 hrs 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

                  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
                  Severity: Minor
                  Found in imcsdk/apis/v2/storage/controller.py - About 6 hrs to fix

                    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
                    Severity: Minor
                    Found in imcsdk/apis/v2/server/bios.py - About 6 hrs 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 _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)
                    Severity: Minor
                    Found in imcsdk/apis/v2/storage/sdcard.py - About 5 hrs 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

                    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
                    Severity: Minor
                    Found in imcsdk/apis/v2/server/bios.py - About 5 hrs to fix

                      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=[
                      Severity: Minor
                      Found in imcsdk/apis/v2/server/vic.py - About 5 hrs 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 mgmt_if_configure has 41 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def mgmt_if_configure(handle,
                      Severity: Major
                      Found in imcsdk/apis/v2/admin/network.py - About 5 hrs to fix

                        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
                        Severity: Minor
                        Found in imcsdk/apis/v2/server/pxe.py - About 5 hrs 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 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.
                        
                        
                        Severity: Minor
                        Found in imcsdk/apis/v2/admin/user.py - About 5 hrs 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_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")
                        Severity: Minor
                        Found in imcsdk/apis/server/inventory.py - About 4 hrs 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