CiscoUcs/imcsdk

View on GitHub
imcsdk/apis/v2/storage/pd.py

Summary

Maintainability
F
5 days
Test Coverage

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

    Function pd_state_exists has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def pd_state_exists(handle,
    Severity: Major
    Found in imcsdk/apis/v2/storage/pd.py - About 50 mins to fix

      Function _pd_set_action has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _pd_set_action(handle, controller_type, controller_slot, drive_slot,
      Severity: Major
      Found in imcsdk/apis/v2/storage/pd.py - About 50 mins to fix

        Function pd_state_set has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def pd_state_set(handle,
        Severity: Major
        Found in imcsdk/apis/v2/storage/pd.py - About 50 mins to fix

          Function pd_set_dedicated_hot_spare has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def pd_set_dedicated_hot_spare(handle, controller_type, controller_slot,
          Severity: Minor
          Found in imcsdk/apis/v2/storage/pd.py - About 45 mins to fix

            Function pd_get has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def pd_get(handle,
            Severity: Minor
            Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

              Function pd_set_removal_prepare has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def pd_set_removal_prepare(handle,
              Severity: Minor
              Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                Function pd_secure_erase_foreign_drives has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def pd_secure_erase_foreign_drives(handle, controller_type, controller_slot,
                Severity: Minor
                Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                  Function pd_encryption_exists has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def pd_encryption_exists(handle, controller_type, controller_slot, drive_slot,
                  Severity: Minor
                  Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                    Function pd_set_boot_drive has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def pd_set_boot_drive(handle,
                    Severity: Minor
                    Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                      Function pd_set_unconfigured_good has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def pd_set_unconfigured_good(handle,
                      Severity: Minor
                      Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                        Function pd_set_jbod has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def pd_set_jbod(handle,
                        Severity: Minor
                        Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                          Function pd_set_global_hot_spare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def pd_set_global_hot_spare(handle,
                          Severity: Minor
                          Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                            Function pd_remove_hot_spare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def pd_remove_hot_spare(handle,
                            Severity: Minor
                            Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                              Function pd_set_removal_undo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def pd_set_removal_undo(handle,
                              Severity: Minor
                              Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                                Function pd_encryption_enable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def pd_encryption_enable(handle,
                                Severity: Minor
                                Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                                  Function pd_encryption_disable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def pd_encryption_disable(handle, controller_type, controller_slot, drive_slot,
                                  Severity: Minor
                                  Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                                    Function pd_encryption_capable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def pd_encryption_capable(handle, controller_type, controller_slot, drive_slot,
                                    Severity: Minor
                                    Found in imcsdk/apis/v2/storage/pd.py - About 35 mins to fix

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                      def pd_encryption_exists(handle, controller_type, controller_slot, drive_slot,
                                                               server_id=1):
                                          """
                                          Checks if encryption is enabled on the physical drive
                                      
                                      
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 1 other location - About 4 hrs to fix
                                      imcsdk/apis/v2/storage/vd.py on lines 686..713

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 75.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 5 locations. Consider refactoring.
                                      Open

                                      def pd_encryption_capable(handle, controller_type, controller_slot, drive_slot,
                                                                server_id=1):
                                          """
                                          Checks if encryption is supported on the physical drive
                                      
                                      
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 4 other locations - About 3 hrs to fix
                                      imcsdk/apis/server/storage.py on lines 826..857
                                      imcsdk/apis/server/storage.py on lines 860..891
                                      imcsdk/apis/v2/server/storage.py on lines 826..857
                                      imcsdk/apis/v2/server/storage.py on lines 860..891

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 70.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                      def pd_get(handle,
                                                 controller_type, controller_slot, drive_slot,
                                                 server_id=1):
                                          """
                                          Gets the physical drive
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 2 other locations - About 2 hrs to fix
                                      imcsdk/apis/server/storage.py on lines 782..810
                                      imcsdk/apis/v2/server/storage.py on lines 782..810

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 57.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_set_removal_prepare(handle,
                                                                 controller_type, controller_slot, drive_slot,
                                                                 server_id=1):
                                          """
                                          Prepare a drive for removal
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_set_unconfigured_good(handle,
                                                                   controller_type, controller_slot, drive_slot,
                                                                   server_id=1):
                                          """
                                          Sets the physical drive in unconfigured good state
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_set_global_hot_spare(handle,
                                                                  controller_type, controller_slot, drive_slot,
                                                                  server_id=1):
                                          """
                                          Sets the physical drive as a global hot spare
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_remove_hot_spare(handle,
                                                              controller_type, controller_slot, drive_slot,
                                                              server_id=1):
                                          """
                                          Removes the physical drive from hot spare pool.
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_encryption_disable(handle, controller_type, controller_slot, drive_slot,
                                                                server_id=1):
                                          """
                                          Disables encryption on the physical drive
                                      
                                      
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_set_boot_drive(handle,
                                                            controller_type, controller_slot, drive_slot,
                                                            server_id=1):
                                          """
                                          Sets the physical drive as boot drive
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 323..346
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 7 locations. Consider refactoring.
                                      Open

                                      def pd_set_removal_undo(handle,
                                                              controller_type, controller_slot, drive_slot,
                                                              server_id=1):
                                          """
                                          Undo a prepare for removal
                                      Severity: Major
                                      Found in imcsdk/apis/v2/storage/pd.py and 6 other locations - About 1 hr to fix
                                      imcsdk/apis/v2/storage/pd.py on lines 72..95
                                      imcsdk/apis/v2/storage/pd.py on lines 147..170
                                      imcsdk/apis/v2/storage/pd.py on lines 214..237
                                      imcsdk/apis/v2/storage/pd.py on lines 247..270
                                      imcsdk/apis/v2/storage/pd.py on lines 290..313
                                      imcsdk/apis/v2/storage/pd.py on lines 620..643

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status