cloudcomputinghust/CAL

View on GitHub
calplus/tests/unit/v1/compute/test_client.py

Summary

Maintainability
F
1 wk
Test Coverage

ClientTest has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class ClientTest(base.TestCase):

    """docstring for ClientTest"""

    def setUp(self):
Severity: Minor
Found in calplus/tests/unit/v1/compute/test_client.py - About 3 hrs to fix

    File test_client.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import mock
    
    from keystoneauth1.exceptions.base import ClientException
    
    from calplus.tests import base
    Severity: Minor
    Found in calplus/tests/unit/v1/compute/test_client.py - About 2 hrs to fix

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

          def test_delete_nic_unable_to_delete(self):
              self.mock_object(
                  self.fake_client.driver, 'delete_nic',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 199..210
      calplus/tests/unit/v1/compute/test_client.py on lines 224..235
      calplus/tests/unit/v1/network/test_client.py on lines 104..113

      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_add_nic_unable_to_add(self):
              self.mock_object(
                  self.fake_client.driver, 'add_nic',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 199..210
      calplus/tests/unit/v1/compute/test_client.py on lines 249..260
      calplus/tests/unit/v1/network/test_client.py on lines 104..113

      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_resize_unable_to_resize(self):
              self.mock_object(
                  self.fake_client.driver, 'resize',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 3 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 224..235
      calplus/tests/unit/v1/compute/test_client.py on lines 249..260
      calplus/tests/unit/v1/network/test_client.py on lines 104..113

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

          def test_start_unable_to_start(self):
              self.mock_object(
                  self.fake_client.driver, 'start',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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 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/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_list_nic_unable_to_list(self):
              self.mock_object(
                  self.fake_client.driver, 'list_nic',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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 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/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_show_unable_to_show(self):
              self.mock_object(
                  self.fake_client.driver, 'show',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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/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_disassociate_public_ip_unable_to_disassociate(self):
              self.mock_object(
                  self.fake_client.driver, 'disassociate_public_ip',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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 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/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_shutdown_unable_to_shutdown(self):
              self.mock_object(
                  self.fake_client.driver, 'shutdown',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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 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/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_reboot_unable_to_reboot(self):
              self.mock_object(
                  self.fake_client.driver, 'reboot',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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 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/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_delete(self):
              self.mock_object(
                  self.fake_client.driver, 'delete',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 71..79
      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/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_list_ip_unable_to_list(self):
              self.mock_object(
                  self.fake_client.driver, 'list_ip',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 15 other locations - About 2 hrs to fix
      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/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/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 5 locations. Consider refactoring.
      Open

          def test_delete_nic_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'delete_nic',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 4 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 187..197
      calplus/tests/unit/v1/compute/test_client.py on lines 212..222
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 251..263
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 285..297

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

          def test_resize_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'resize',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 4 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 212..222
      calplus/tests/unit/v1/compute/test_client.py on lines 237..247
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 251..263
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 285..297

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

          def test_add_nic_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'add_nic',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 4 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 187..197
      calplus/tests/unit/v1/compute/test_client.py on lines 237..247
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 251..263
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 285..297

      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(self):
              self.mock_object(
                  self.fake_client.driver, 'list',
                  mock.Mock(side_effect=ClientException))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 5 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 213..220
      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 13 locations. Consider refactoring.
      Open

          def test_reboot_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'reboot',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_disassociate_public_ip_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'disassociate_public_ip',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_delete_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'delete',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_shutdown_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'shutdown',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_start_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'start',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_list_ip_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'list_ip',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 262..269
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_list_nic_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'list_nic',
                  mock.Mock(return_value=True))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 12 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/compute/test_client.py on lines 103..110
      calplus/tests/unit/v1/compute/test_client.py on lines 124..131
      calplus/tests/unit/v1/compute/test_client.py on lines 145..152
      calplus/tests/unit/v1/compute/test_client.py on lines 166..173
      calplus/tests/unit/v1/compute/test_client.py on lines 308..316
      calplus/tests/unit/v1/compute/test_client.py on lines 330..337
      calplus/tests/unit/v1/network/test_client.py on lines 188..196
      calplus/tests/unit/v1/network/test_client.py on lines 210..218
      calplus/tests/unit/v1/network/test_client.py on lines 274..281
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 76..82
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 89..95
      calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 113..119

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

          def test_show_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'show',
                  mock.Mock(return_value="return object"))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 2 other locations - About 2 hrs to fix
      calplus/tests/unit/v1/object_storage/test_client.py on lines 30..37
      calplus/tests/unit/v1/object_storage/test_client.py on lines 50..58

      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_list_successfully(self):
              self.mock_object(
                  self.fake_client.driver, 'list',
                  mock.Mock(return_value="list server objects"))
      
      
      Severity: Major
      Found in calplus/tests/unit/v1/compute/test_client.py and 1 other location - About 2 hrs to fix
      calplus/tests/unit/v1/network/test_client.py on lines 253..260

      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 setUp(self):
              super(ClientTest, self).setUp()
              self.fake_client = client.Client(
                  'OpenStack', fake_config_driver)
      Severity: Minor
      Found in calplus/tests/unit/v1/compute/test_client.py and 2 other locations - About 30 mins to fix
      calplus/tests/unit/v1/network/test_client.py on lines 87..90
      calplus/tests/unit/v1/object_storage/test_client.py on lines 25..28

      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