cloudcomputinghust/CAL

View on GitHub
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py

Summary

Maintainability
F
5 days
Test Coverage

File test_amazon_driver.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" AmazonDriver for Compute
    based on BaseDriver for Compute Resource
"""


Severity: Minor
Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py - About 4 hrs to fix

    AmazonDriverTest has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AmazonDriverTest(base.TestCase):
    
        """docstring for AmazonDriverTest"""
    
        def setUp(self):
    Severity: Minor
    Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py - About 2 hrs to fix

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

          def test_show_unable_to_show(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 3 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 413..425
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 437..449
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 252..264

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

      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 test_list_nic_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 3 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 239..252
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 437..449
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 252..264

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

      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 test_list_ip_unable_to_delete(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 3 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 239..252
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 413..425
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 252..264

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

      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 test_list_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 276..288
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 422..435
      calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 248..259

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

      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 test_list_nic_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(return_value=fake_describe_return))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 229..237
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 427..435
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 243..250

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

          def test_show_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(return_value=fake_describe_return))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 403..411
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 427..435
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 243..250

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

          def test_list_ip_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(return_value=fake_describe_return))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 229..237
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 403..411
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 243..250

      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 test_list_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'describe_instances',
                  mock.Mock(return_value=fake_describe_return))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 5 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 266..273
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 412..419
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 446..456
      calplus/tests/unit/v1/network/test_client.py on lines 232..239
      calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 239..246

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

          def test_shutdown_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 286..296
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 324..334
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 343..353

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

      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 test_reboot_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 286..296
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 305..315
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 324..334

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

      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 test_delete_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 305..315
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 324..334
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 343..353

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

      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 test_start_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(side_effect=ClientError(
                      fake_error_code,
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 286..296
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 305..315
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 343..353

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

      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 test_reboot_successfully(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(return_value=FakeInstance()))
      
      
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 279..284
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 298..303
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 317..322

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

      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 test_delete_successfully(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(return_value=FakeInstance()))
      
      
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 298..303
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 317..322
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 336..341

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

      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 test_start_successfully(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(return_value=FakeInstance()))
      
      
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 279..284
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 298..303
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 336..341

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

      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 test_shutdown_successfully(self):
              self.mock_object(
                  self.fake_driver.resource, 'Instance',
                  mock.Mock(return_value=FakeInstance()))
      
      
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 279..284
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 317..322
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 336..341

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

      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

              self.fake_driver.resource.create_instances. \
                  assert_called_once_with(
                      ImageId='fake_image_id',
                      MinCount=1,
                      MaxCount=1,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 1 other location - About 1 hr to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 216..225

      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

              self.fake_driver.resource.create_instances. \
                  assert_called_once_with(
                      ImageId='fake_image_id',
                      MinCount=1,
                      MaxCount=1,
      Severity: Major
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 1 other location - About 1 hr to fix
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 188..197

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

      fake_error_code = {
          'ResponseMetadata': {
              'HTTPStatusCode': 400,
              'RequestId': 'req-a4570d1a-8319-4d6f-8077-7044d72ef449',
              'HTTPHeaders': {
      Severity: Minor
      Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py and 2 other locations - About 35 mins to fix
      calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 108..120
      calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 191..203

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

      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