CiscoUcs/imcsdk

View on GitHub
imcsdk/apis/server/storage.py

Summary

Maintainability
F
2 wks
Test Coverage

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

    Function virtual_drive_create has 15 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def virtual_drive_create(handle,
    Severity: Major
    Found in imcsdk/apis/server/storage.py - About 1 hr to fix

      Function controller_encryption_enable has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def controller_encryption_enable(handle, controller_type,
      Severity: Major
      Found in imcsdk/apis/server/storage.py - About 1 hr to fix

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

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

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

          def _physical_drive_action_set(handle, controller_type,
          Severity: Minor
          Found in imcsdk/apis/server/storage.py - About 45 mins to fix

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

            def _vd_max_size_get(handle,
            Severity: Minor
            Found in imcsdk/apis/server/storage.py - About 45 mins to fix

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

              def _controller_action_set(handle, controller_type, controller_slot, action,
              Severity: Minor
              Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

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

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

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

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

                    def virtual_drive_encryption_enable(handle, controller_type,
                    Severity: Minor
                    Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                      def virtual_drive_set_boot_drive(handle, controller_type, controller_slot, name, server_id=1):
                      Severity: Minor
                      Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                        def is_physical_drive_encryption_enabled(handle, controller_type,
                        Severity: Minor
                        Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                          def physical_drive_set_jbod_mode(handle, controller_type,
                          Severity: Minor
                          Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                            def is_physical_drive_encryption_capable(handle, controller_type,
                            Severity: Minor
                            Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                              def physical_drive_encryption_disable(handle, controller_type,
                              Severity: Minor
                              Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                                def controller_unlock_foreign_drives(handle, controller_type,
                                Severity: Minor
                                Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                                  def physical_drive_encryption_enable(handle, controller_type,
                                  Severity: Minor
                                  Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

                                    def physical_drive_secure_erase_foreign_drives(
                                    Severity: Minor
                                    Found in imcsdk/apis/server/storage.py - About 35 mins to fix

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

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

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

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

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

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

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

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

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

                                              def virtual_drive_create(handle,
                                                                       drive_group,
                                                                       controller_type,
                                                                       controller_slot,
                                                                       raid_level=0,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 2 days to fix
                                              imcsdk/apis/v2/server/storage.py on lines 193..278

                                              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 290.

                                              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 2 locations. Consider refactoring.
                                              Open

                                              def controller_encryption_enable(handle, controller_type,
                                                                               controller_slot, key_id, security_key,
                                                                               key_management="local", server_id=1,
                                                                               **kwargs):
                                                  """
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 6 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 497..547

                                              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 106.

                                              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

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

                                                  size = {0: total_size,
                                                          1: total_size/2,
                                                          5: total_size - (span_depth * 1 * min_size),
                                                          6: total_size - (span_depth * 2 * min_size),
                                                          10: total_size/2,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 6 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 134..140
                                              imcsdk/apis/v2/storage/vd.py on lines 138..144

                                              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 105.

                                              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

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

                                              def _vd_max_size_get(handle,
                                                                   controller_type,
                                                                   controller_slot,
                                                                   drive_list,
                                                                   raid_level,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 5 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 147..173
                                              imcsdk/apis/v2/storage/vd.py on lines 152..178

                                              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 89.

                                              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 2 locations. Consider refactoring.
                                              Open

                                              def controller_encryption_modify_security_key(handle,
                                                                                            controller_type,
                                                                                            controller_slot,
                                                                                            existing_security_key,
                                                                                            security_key,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 4 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 613..657

                                              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 81.

                                              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

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

                                              def is_controller_jbod_mode_enabled(handle, controller_type,
                                                                                  controller_slot, server_id=1):
                                                  """
                                                  Checks if jbod mode is enabled on the controller
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 472..494

                                              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 72.

                                              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

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

                                              def _physical_drive_action_set(handle, controller_type,
                                                                             controller_slot, drive_slot,
                                                                             action, server_id=1):
                                                  mo = physical_drive_get(handle, controller_type, controller_slot,
                                                                     drive_slot, server_id)
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 813..823

                                              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 71.

                                              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 is_physical_drive_encryption_enabled(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/server/storage.py and 4 other locations - About 3 hrs to fix
                                              imcsdk/apis/server/storage.py on lines 826..857
                                              imcsdk/apis/v2/server/storage.py on lines 826..857
                                              imcsdk/apis/v2/server/storage.py on lines 860..891
                                              imcsdk/apis/v2/storage/pd.py on lines 510..537

                                              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 4 locations. Consider refactoring.
                                              Open

                                              def virtual_drive_set_boot_drive(handle, controller_type, controller_slot, name, server_id=1):
                                                  """
                                                  Set a virtual drive as boot drive.
                                              
                                                  Args:
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 3 other locations - About 3 hrs to fix
                                              imcsdk/apis/server/storage.py on lines 346..376
                                              imcsdk/apis/v2/server/storage.py on lines 346..376
                                              imcsdk/apis/v2/server/storage.py on lines 379..407

                                              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 4 locations. Consider refactoring.
                                              Open

                                              def virtual_drive_encryption_enable(handle, controller_type,
                                                                                  controller_slot, name, server_id=1):
                                                  """
                                                  Enables encryption on the virtual drive if it is supported by the controller
                                                  and the underlying physical drive
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 3 other locations - About 3 hrs to fix
                                              imcsdk/apis/server/storage.py on lines 379..407
                                              imcsdk/apis/v2/server/storage.py on lines 346..376
                                              imcsdk/apis/v2/server/storage.py on lines 379..407

                                              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_sizes_get(handle,
                                                                controller_type,
                                                                controller_slot,
                                                                drive_list,
                                                                server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 104..118
                                              imcsdk/apis/v2/storage/vd.py on lines 104..118

                                              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 5 locations. Consider refactoring.
                                              Open

                                              def is_physical_drive_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/server/storage.py and 4 other locations - About 3 hrs to fix
                                              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
                                              imcsdk/apis/v2/storage/pd.py on lines 510..537

                                              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

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

                                              def controller_unlock_foreign_drives(handle, controller_type,
                                                                                   controller_slot, security_key,
                                                                                   server_id=1):
                                                  """
                                                  Unlocks on the given controller, drives encrypted on another controller.
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 718..750

                                              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 69.

                                              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

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

                                              def vd_query_by_name(handle,
                                                                   controller_type,
                                                                   controller_slot,
                                                                   name,
                                                                   server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 281..292

                                              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 64.

                                              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 controller_encryption_disable(handle, controller_type,
                                                                                controller_slot, server_id=1):
                                                  """
                                                  Disables encryption on the controller
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 550..581
                                              imcsdk/apis/v2/storage/controller.py on lines 248..275

                                              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 64.

                                              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

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

                                              def physical_drive_set_jbod_mode(handle, controller_type,
                                                                               controller_slot, drive_slot, server_id=1):
                                                  """
                                                  Sets the physical drive in jbod mode
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 3 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 894..926

                                              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 63.

                                              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 _get_controller(handle, controller_type, controller_slot, server_id=1):
                                                  mo = handle.query_dn(_get_controller_dn(handle,
                                                                                          controller_type,
                                                                                          controller_slot,
                                                                                          server_id))
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 2 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 181..190
                                              imcsdk/apis/v2/storage/controller.py on lines 35..44

                                              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 59.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              def controller_encryption_key_generate(handle, controller_type,
                                                                                     controller_slot, server_id=1):
                                                  """
                                                  Generates a random security key for the given controller
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 5 other locations - About 2 hrs to fix
                                              imcsdk/apis/server/storage.py on lines 660..686
                                              imcsdk/apis/v2/server/storage.py on lines 660..686
                                              imcsdk/apis/v2/server/storage.py on lines 689..715
                                              imcsdk/apis/v2/storage/controller.py on lines 278..305
                                              imcsdk/apis/v2/storage/controller.py on lines 308..335

                                              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 59.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              def controller_encryption_key_id_generate(handle, controller_type,
                                                                                        controller_slot, server_id=1):
                                                  """
                                                  Generates a random key id for the given controller
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 5 other locations - About 2 hrs to fix
                                              imcsdk/apis/server/storage.py on lines 689..715
                                              imcsdk/apis/v2/server/storage.py on lines 660..686
                                              imcsdk/apis/v2/server/storage.py on lines 689..715
                                              imcsdk/apis/v2/storage/controller.py on lines 278..305
                                              imcsdk/apis/v2/storage/controller.py on lines 308..335

                                              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 59.

                                              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 physical_drive_get(handle,
                                                                     controller_type,
                                                                     controller_slot,
                                                                     drive_slot,
                                                                     server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 2 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 782..810
                                              imcsdk/apis/v2/storage/pd.py on lines 28..55

                                              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

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

                                              def controller_encryption_exists(handle, controller_type, controller_slot,
                                                                               server_id=1):
                                                  """
                                                  Checks if encryption is enabled on the controller
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 2 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 584..610

                                              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

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

                                              def _controller_action_set(handle, controller_type, controller_slot, action,
                                                                         server_id=1):
                                                  controller_mo = _get_controller(handle,
                                                                                  controller_type,
                                                                                  controller_slot,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 2 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 409..417

                                              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 51.

                                              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 _get_controller_dn(handle, controller_type, controller_slot, server_id=1):
                                                  server_dn = imccoreutils.get_server_dn(handle, server_id)
                                                  return (server_dn + "/board/storage-" + controller_type + "-" + controller_slot)
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 2 hrs to fix
                                              imcsdk/apis/v2/server/storage.py on lines 176..178
                                              imcsdk/apis/v2/storage/controller.py on lines 30..32

                                              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 50.

                                              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

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

                                              def virtual_drive_delete(handle,
                                                                       controller_type,
                                                                       controller_slot,
                                                                       name,
                                                                       server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 1 hr to fix
                                              imcsdk/apis/v2/server/storage.py on lines 318..343

                                              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 47.

                                              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 8 locations. Consider refactoring.
                                              Open

                                              def physical_drive_set_unconfigured_good(handle,
                                                                                       controller_type,
                                                                                       controller_slot,
                                                                                       drive_slot,
                                                                                       server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 7 other locations - About 1 hr to fix
                                              imcsdk/apis/server/storage.py on lines 968..997
                                              imcsdk/apis/server/storage.py on lines 1002..1031
                                              imcsdk/apis/server/storage.py on lines 1036..1069
                                              imcsdk/apis/v2/server/storage.py on lines 931..963
                                              imcsdk/apis/v2/server/storage.py on lines 968..997
                                              imcsdk/apis/v2/server/storage.py on lines 1002..1031
                                              imcsdk/apis/v2/server/storage.py on lines 1036..1069

                                              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 40.

                                              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 8 locations. Consider refactoring.
                                              Open

                                              def physical_drive_encryption_disable(handle, controller_type,
                                                                                    controller_slot, drive_slot, server_id=1):
                                                  """
                                                  Disables encryption on the physical drive
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 7 other locations - About 1 hr to fix
                                              imcsdk/apis/server/storage.py on lines 931..963
                                              imcsdk/apis/server/storage.py on lines 968..997
                                              imcsdk/apis/server/storage.py on lines 1036..1069
                                              imcsdk/apis/v2/server/storage.py on lines 931..963
                                              imcsdk/apis/v2/server/storage.py on lines 968..997
                                              imcsdk/apis/v2/server/storage.py on lines 1002..1031
                                              imcsdk/apis/v2/server/storage.py on lines 1036..1069

                                              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 40.

                                              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 8 locations. Consider refactoring.
                                              Open

                                              def physical_drive_encryption_enable(handle, controller_type,
                                                                                   controller_slot, drive_slot, server_id=1):
                                                  """
                                                  Enables encryption on the physical drive
                                              
                                              
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 7 other locations - About 1 hr to fix
                                              imcsdk/apis/server/storage.py on lines 931..963
                                              imcsdk/apis/server/storage.py on lines 1002..1031
                                              imcsdk/apis/server/storage.py on lines 1036..1069
                                              imcsdk/apis/v2/server/storage.py on lines 931..963
                                              imcsdk/apis/v2/server/storage.py on lines 968..997
                                              imcsdk/apis/v2/server/storage.py on lines 1002..1031
                                              imcsdk/apis/v2/server/storage.py on lines 1036..1069

                                              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 40.

                                              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 8 locations. Consider refactoring.
                                              Open

                                              def physical_drive_secure_erase_foreign_drives(
                                                              handle,
                                                              controller_type,
                                                              controller_slot,
                                                              drive_slot,
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 7 other locations - About 1 hr to fix
                                              imcsdk/apis/server/storage.py on lines 931..963
                                              imcsdk/apis/server/storage.py on lines 968..997
                                              imcsdk/apis/server/storage.py on lines 1002..1031
                                              imcsdk/apis/v2/server/storage.py on lines 931..963
                                              imcsdk/apis/v2/server/storage.py on lines 968..997
                                              imcsdk/apis/v2/server/storage.py on lines 1002..1031
                                              imcsdk/apis/v2/server/storage.py on lines 1036..1069

                                              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 40.

                                              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

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

                                              def virtual_drive_exists(handle,
                                                                       controller_type,
                                                                       controller_slot,
                                                                       virtual_drive_name,
                                                                       server_id=1):
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 1 hr to fix
                                              imcsdk/apis/v2/server/storage.py on lines 295..315

                                              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 40.

                                              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

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

                                              def _list_to_string(drive_list):
                                                  # convert to format imc expects
                                                  # list to string
                                                  # [[1]] => '[1]'
                                                  # [[1,2],[3,4]] => '[1,2][3,4]'
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 1 hr to fix
                                              imcsdk/apis/v2/server/storage.py on lines 34..45
                                              imcsdk/apis/v2/storage/vd.py on lines 34..45

                                              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 38.

                                              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

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

                                              def _flatten_to_string(drive_list):
                                                  # convert to format imc expects
                                                  # [[1]] => '1'
                                                  # [[1,2],[3,4]] => '1234'
                                                  return ''.join([''.join(str(x)) for x in _flatten_list(drive_list)])
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 55 mins to fix
                                              imcsdk/apis/v2/server/storage.py on lines 61..65
                                              imcsdk/apis/v2/storage/vd.py on lines 61..65

                                              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 37.

                                              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

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

                                              def vd_name_derive(raid_level, drive_list):
                                                  return "RAID" + str(raid_level) + "_" + _flatten_to_string(drive_list)
                                              Severity: Major
                                              Found in imcsdk/apis/server/storage.py and 2 other locations - About 50 mins to fix
                                              imcsdk/apis/v2/server/storage.py on lines 68..69
                                              imcsdk/apis/v2/storage/vd.py on lines 68..69

                                              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 36.

                                              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

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

                                              def controller_import_foreign_config(handle, controller_type,
                                                                                   controller_slot, server_id=1):
                                                  """
                                                  Imports foreign configuration on the given controller
                                              
                                              
                                              Severity: Minor
                                              Found in imcsdk/apis/server/storage.py and 1 other location - About 30 mins to fix
                                              imcsdk/apis/v2/server/storage.py on lines 753..778

                                              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 32.

                                              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