cloudcomputinghust/CAL

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

Summary

Maintainability
F
5 days
Test Coverage

ClientTest has 21 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/network/test_client.py - About 2 hrs to fix

    TODO found
    Open

            #TODO: alter None with exact return format

    TODO found
    Open

            #TODO: alter None with exact return format

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

        def test_create_unable_to_create(self):
            self.mock_object(
                self.fake_client.driver, 'create',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/compute/test_client.py on lines 249..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 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_disconnect_external_net_unable_to_disconnect(self):
            self.mock_object(
                self.fake_client.driver, 'disconnect_external_net',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/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 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/network/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/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 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/network/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/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 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_connect_external_net_unable_to_connect(self):
            self.mock_object(
                self.fake_client.driver, 'connect_external_net',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/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 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_ip_unable_to_release(self):
            self.mock_object(
                self.fake_client.driver, 'release_public_ip',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/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

    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_client.driver, 'show',
                mock.Mock(return_value={
                    'subnet': fake_subnet_out
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 1 other location - About 2 hrs to fix
    calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 179..187

    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_list_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'list',
                mock.Mock(return_value={
                    'subnets': [fake_subnet_out]
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 1 other location - About 2 hrs to fix
    calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 201..210

    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_public_ip_unable_to_list(self):
            self.mock_object(
                self.fake_client.driver, 'list_public_ip',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 5 other locations - About 2 hrs to fix
    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/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

    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_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/network/test_client.py and 5 other locations - About 2 hrs to fix
    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/drivers/test_openstack_driver.py on lines 459..468
    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_allocate_public_ip_unable_to_allocate(self):
            self.mock_object(
                self.fake_client.driver, 'allocate_public_ip',
                mock.Mock(side_effect=ClientException))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 5 other locations - About 2 hrs to fix
    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/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 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_release_public_ip_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'release_public_ip',
                mock.Mock(return_value=True))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/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/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_connect_external_net_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'connect_external_net',
                mock.Mock(return_value=None))
            #TODO: alter None with exact return format
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/compute/test_client.py on lines 330..337
    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_disconnect_external_net_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'disconnect_external_net',
                mock.Mock(return_value=None))
            #TODO: alter None with exact return format
    Severity: Major
    Found in calplus/tests/unit/v1/network/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/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 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 6 locations. Consider refactoring.
    Open

        def test_allocate_public_ip_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'allocate_public_ip',
                mock.Mock(return_value=True))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 5 other locations - About 2 hrs to fix
    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/drivers/test_openstack_driver.py on lines 446..456
    calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 239..246

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 51.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_list_public_ip_successfully(self):
            self.mock_object(
                self.fake_client.driver, 'list_public_ip',
                mock.Mock(return_value='fake_list_ip'))
    
    
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 1 other location - About 2 hrs to fix
    calplus/tests/unit/v1/compute/test_client.py on lines 82..89

    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',
    Severity: Major
    Found in calplus/tests/unit/v1/network/test_client.py and 2 other locations - About 1 hr to fix
    calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 13..32
    calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 11..30

    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/test_client.py and 1 other location - About 35 mins to fix
    calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 50..62

    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

    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/network/test_client.py and 2 other locations - About 30 mins to fix
    calplus/tests/unit/v1/compute/test_client.py on lines 31..34
    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