cloudcomputinghust/CAL

View on GitHub
calplus/tests/unit/v1/network/drivers/test_openstack_driver.py

Summary

Maintainability
F
6 days
Test Coverage

File test_openstack_driver.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" OpenstackDriver for Network
    based on BaseDriver for Network Resource
"""


Severity: Minor
Found in calplus/tests/unit/v1/network/drivers/test_openstack_driver.py - About 5 hrs to fix

    OpenstackDriverTest has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class OpenstackDriverTest(base.TestCase):
    
        """docstring for OpenstackDriverTest"""
    
        def setUp(self):
    Severity: Minor
    Found in calplus/tests/unit/v1/network/drivers/test_openstack_driver.py - About 3 hrs to fix

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

          def test_show_unable_to_show_network(self):
              self.mock_object(
                  self.fake_driver.client, 'show_subnet',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/compute/test_client.py on lines 71..79
      calplus/tests/unit/v1/compute/test_client.py on lines 113..121
      calplus/tests/unit/v1/compute/test_client.py on lines 134..142
      calplus/tests/unit/v1/compute/test_client.py on lines 155..163
      calplus/tests/unit/v1/compute/test_client.py on lines 176..184
      calplus/tests/unit/v1/compute/test_client.py on lines 272..280
      calplus/tests/unit/v1/compute/test_client.py on lines 319..327
      calplus/tests/unit/v1/compute/test_client.py on lines 340..348
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 239..247
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 484..493
      calplus/tests/unit/v1/network/test_client.py on lines 125..133
      calplus/tests/unit/v1/network/test_client.py on lines 171..179
      calplus/tests/unit/v1/network/test_client.py on lines 199..207
      calplus/tests/unit/v1/network/test_client.py on lines 221..229
      calplus/tests/unit/v1/network/test_client.py on lines 284..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 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 16 locations. Consider refactoring.
      Open

          def test_delete_unable_to_detete_network(self):
              self.mock_object(
                  self.fake_driver.client, 'delete_network',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/compute/test_client.py on lines 71..79
      calplus/tests/unit/v1/compute/test_client.py on lines 113..121
      calplus/tests/unit/v1/compute/test_client.py on lines 134..142
      calplus/tests/unit/v1/compute/test_client.py on lines 155..163
      calplus/tests/unit/v1/compute/test_client.py on lines 176..184
      calplus/tests/unit/v1/compute/test_client.py on lines 272..280
      calplus/tests/unit/v1/compute/test_client.py on lines 319..327
      calplus/tests/unit/v1/compute/test_client.py on lines 340..348
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 190..198
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 484..493
      calplus/tests/unit/v1/network/test_client.py on lines 125..133
      calplus/tests/unit/v1/network/test_client.py on lines 171..179
      calplus/tests/unit/v1/network/test_client.py on lines 199..207
      calplus/tests/unit/v1/network/test_client.py on lines 221..229
      calplus/tests/unit/v1/network/test_client.py on lines 284..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 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 16 locations. Consider refactoring.
      Open

          def test_release_public_ips_unable_to_release(self):
              self.mock_object(
                  self.fake_driver.client, 'delete_floatingip',
                  mock.Mock(side_effect=ClientException)
              )
      calplus/tests/unit/v1/compute/test_client.py on lines 71..79
      calplus/tests/unit/v1/compute/test_client.py on lines 113..121
      calplus/tests/unit/v1/compute/test_client.py on lines 134..142
      calplus/tests/unit/v1/compute/test_client.py on lines 155..163
      calplus/tests/unit/v1/compute/test_client.py on lines 176..184
      calplus/tests/unit/v1/compute/test_client.py on lines 272..280
      calplus/tests/unit/v1/compute/test_client.py on lines 319..327
      calplus/tests/unit/v1/compute/test_client.py on lines 340..348
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 190..198
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 239..247
      calplus/tests/unit/v1/network/test_client.py on lines 125..133
      calplus/tests/unit/v1/network/test_client.py on lines 171..179
      calplus/tests/unit/v1/network/test_client.py on lines 199..207
      calplus/tests/unit/v1/network/test_client.py on lines 221..229
      calplus/tests/unit/v1/network/test_client.py on lines 284..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 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 2 locations. Consider refactoring.
      Open

          def test_show_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'show_subnet',
                  mock.Mock(return_value={
                      'subnet': fake_subnet_out
      calplus/tests/unit/v1/network/test_client.py on lines 159..168

      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_get_networks_unable_to_get_quota(self):
              self.mock_object(
                  self.fake_driver.client, 'list_subnets',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 334..342
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 357..365
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 380..388

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

      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_get_internet_gateways_unable_to_get_quota(self):
              self.mock_object(
                  self.fake_driver.client, 'list_routers',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 285..293
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 334..342
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 357..365

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

      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_get_floating_ips_unable_to_get_quota(self):
              self.mock_object(
                  self.fake_driver.client, 'list_floatingips',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 285..293
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 357..365
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 380..388

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

      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_get_routers_unable_to_get_quota(self):
              self.mock_object(
                  self.fake_driver.client, 'list_routers',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 285..293
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 334..342
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 380..388

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

      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 test_get_routers(self):
              self.mock_object(
                  self.fake_driver.client, 'list_routers',
                  mock.Mock(return_value={
                      'routers': fake_router
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 368..377

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 57.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_get_internet_gateways(self):
              self.mock_object(
                  self.fake_driver.client, 'list_routers',
                  mock.Mock(return_value={
                      'routers': fake_router
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 345..354

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 57.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_list_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'list_subnets',
                  mock.Mock(return_value={
                      'subnets': [fake_subnet_out]
      calplus/tests/unit/v1/network/test_client.py on lines 136..145

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 57.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_list_unable_to_list_network(self):
              self.mock_object(
                  self.fake_driver.client, 'list_subnets',
                  mock.Mock(side_effect=ClientException))
      
      
      calplus/tests/unit/v1/compute/test_client.py on lines 92..100
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 459..468
      calplus/tests/unit/v1/network/test_client.py on lines 148..156
      calplus/tests/unit/v1/network/test_client.py on lines 242..250
      calplus/tests/unit/v1/network/test_client.py on lines 263..271

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

      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_public_ips_unable_to_list(self):
              self.mock_object(
                  self.fake_driver.client, 'list_floatingips',
                  mock.Mock(side_effect=ClientException)
              )
      calplus/tests/unit/v1/compute/test_client.py on lines 92..100
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 213..220
      calplus/tests/unit/v1/network/test_client.py on lines 148..156
      calplus/tests/unit/v1/network/test_client.py on lines 242..250
      calplus/tests/unit/v1/network/test_client.py on lines 263..271

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

      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 test_release_public_ips(self):
              self.mock_object(
                  self.fake_driver.client, 'delete_floatingip',
                  mock.Mock(return_value=())
              )
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 229..236

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

      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 test_delete_successfully(self):
              self.mock_object(
                  self.fake_driver.client, 'delete_network',
                  mock.Mock(return_value=()))
      
      
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 471..481

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

      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_public_ips(self):
              self.mock_object(
                  self.fake_driver.client, 'list_floatingips',
                  mock.Mock(return_value=fake_list_ip_out)
              )
      calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 254..261
      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/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

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

      fake_config_driver = {
          'os_auth_url': 'http://controller:5000/v2_0',
          'os_username': 'test',
          'os_password': 'veryhard',
          'os_project_name': 'demo',
      calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 13..32
      calplus/tests/unit/v1/network/test_client.py on lines 8..27

      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

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

      fake_subnet_out = {
          'name': 'fake_name',
          'description': None,
          'id': 'fake_id',
          'cidr': 'fake_cidr',
      Severity: Minor
      Found in calplus/tests/unit/v1/network/drivers/test_openstack_driver.py and 1 other location - About 35 mins to fix
      calplus/tests/unit/v1/network/test_client.py on lines 47..59

      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