CiscoUcs/imcsdk

View on GitHub

Showing 440 of 1,826 total issues

File imcconstants.py has 2052 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: Major
Found in imcsdk/imcconstants.py - About 5 days to fix

    File BiosVfPCISlotOptionROMEnable.py has 1731 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """This module contains the general information for BiosVfPCISlotOptionROMEnable ManagedObject."""
    
    from ...imcmo import ManagedObject
    from ...imccoremeta import MoPropertyMeta, MoMeta
    from ...imcmeta import VersionMeta
    Severity: Major
    Found in imcsdk/mometa/bios/BiosVfPCISlotOptionROMEnable.py - About 4 days to fix

      File imcmeta.py has 1455 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: Major
      Found in imcsdk/imcmeta.py - About 3 days to fix

        File storage.py has 874 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: Major
        Found in imcsdk/apis/server/storage.py - About 2 days to fix

          File storage.py has 874 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: Major
          Found in imcsdk/apis/v2/server/storage.py - About 2 days to fix

            File imccoreutils.py has 757 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
            Severity: Major
            Found in imcsdk/imccoreutils.py - About 1 day to fix

              File snmp.py has 723 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: Major
              Found in imcsdk/apis/v2/admin/snmp.py - About 1 day to fix

                File vic.py has 701 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: Major
                Found in imcsdk/apis/v2/server/vic.py - About 1 day to fix

                  File sdcard.py has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # Copyright 2018 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: Major
                  Found in imcsdk/apis/v2/storage/sdcard.py - About 1 day to fix

                    File imcbiostables.py has 604 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: Major
                    Found in imcsdk/imcbiostables.py - About 1 day to fix

                      File ldap.py has 590 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: Major
                      Found in imcsdk/apis/v2/admin/ldap.py - About 1 day to fix

                        File GenerateCertificateSigningRequest.py has 588 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """This module contains the general information for GenerateCertificateSigningRequest ManagedObject."""
                        
                        from ...imcmo import ManagedObject
                        from ...imccoremeta import MoPropertyMeta, MoMeta
                        from ...imcmeta import VersionMeta
                        Severity: Major
                        Found in imcsdk/mometa/generate/GenerateCertificateSigningRequest.py - About 1 day to fix

                          File vd.py has 586 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: Major
                          Found in imcsdk/apis/v2/storage/vd.py - About 1 day to fix

                            File imcmo.py has 585 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
                            Severity: Major
                            Found in imcsdk/imcmo.py - About 1 day to fix

                              File imcsession.py has 560 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: Major
                              Found in imcsdk/imcsession.py - About 1 day to fix

                                File imchandle.py has 557 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: Major
                                Found in imcsdk/imchandle.py - About 1 day to fix

                                  File pd.py has 529 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: Major
                                  Found in imcsdk/apis/v2/storage/pd.py - About 1 day to fix

                                    File TopSystem.py has 524 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    """This module contains the general information for TopSystem ManagedObject."""
                                    
                                    from ...imcmo import ManagedObject
                                    from ...imccoremeta import MoPropertyMeta, MoMeta
                                    from ...imcmeta import VersionMeta
                                    Severity: Major
                                    Found in imcsdk/mometa/top/TopSystem.py - About 1 day to fix

                                      File network.py has 508 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: Major
                                      Found in imcsdk/apis/v2/admin/network.py - About 1 day to fix

                                        Function _sd_card_config_set_m4 has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        def _sd_card_config_set_m4(handle, expected_vds, existing_vds, mos_dict=None):
                                            if mos_dict is None:
                                                mos_dict = _prepare_mos_dict(handle, expected_vds.keys())
                                        
                                            is_mode_changed = False
                                        Severity: Minor
                                        Found in imcsdk/apis/v2/storage/sdcard.py - About 1 day 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