cloudcomputinghust/CAL

View on GitHub

Showing 192 of 240 total issues

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

    def test_stat_container_failed(self):
        self.mock_object(
            self.fake_driver.client,
            'head_container',
            mock.Mock(side_effect=ClientException(
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 98..110

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

    def _check_external_network(self):
        networks = self.client.list_networks().get('networks')
        for network in networks:
            external = network.get('provider:physical_network')
            if external is not None:
Severity: Major
Found in calplus/v1/network/drivers/openstack.py and 1 other location - About 3 hrs to fix
calplus/v1/network/drivers/openstack.py on lines 56..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 62.

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 _check_router_external_gateway(self):
        routers = self.client.list_routers().get('routers')
        for router in routers:
            external = router.get('external_gateway_info')
            if external is not None:
Severity: Major
Found in calplus/v1/network/drivers/openstack.py and 1 other location - About 3 hrs to fix
calplus/v1/network/drivers/openstack.py on lines 48..54

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

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

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

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

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

Refactorings

Further Reading

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

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

    def test_download_object_successfully(self):
        self.mock_object(
            self.fake_driver.client, 'get_object',
            mock.Mock(return_value=fake_download_object_resp)
        )
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 368..375
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 397..404

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

    def test_list_containers_failed(self):
        self.mock_object(
            self.fake_driver.client, 'list_buckets',
            mock.Mock(side_effect=ClientError(
                fake_error_code_resp,
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 264..276
calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 276..288
calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 422..435

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

    def test_list_public_ip_unable_to_list(self):
        self.mock_object(
            self.fake_driver.client, 'describe_addresses',
            mock.Mock(side_effect=ClientError(
                fake_error_code,
Severity: Major
Found in calplus/tests/unit/v1/network/drivers/test_amazon_driver.py and 3 other locations - About 2 hrs to fix
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 264..276
calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 276..288
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 248..259

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

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

        result = {'name': subnet['name'],
                  'description': None,
                  'id': subnet['id'],
                  'cidr': subnet['cidr'],
                  'cloud': PROVIDER,
Severity: Major
Found in calplus/v1/network/drivers/openstack.py and 2 other locations - About 2 hrs to fix
calplus/v1/network/drivers/openstack.py on lines 97..105
calplus/v1/network/drivers/openstack.py on lines 114..122

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

    def test_delete_object_successfully(self):
        self.mock_object(
            self.fake_driver.client, 'delete_object',
            mock.Mock(return_value=fake_delete_object_resp)
        )
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 339..346
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 368..375

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

    def test_stat_object_successfully(self):
        self.mock_object(
            self.fake_driver.client, 'head_object',
            mock.Mock(return_value=fake_stat_object_resp)
        )
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 339..346
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 397..404

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

        result = {'name': subnet['name'],
                  'description': None,
                  'id': subnet['id'],
                  'cidr': subnet['cidr'],
                  'cloud': PROVIDER,
Severity: Major
Found in calplus/v1/network/drivers/openstack.py and 2 other locations - About 2 hrs to fix
calplus/v1/network/drivers/openstack.py on lines 81..89
calplus/v1/network/drivers/openstack.py on lines 114..122

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

            sub = {'name': subnet['name'],
                   'description': None,
                   'id': subnet['id'],
                   'cidr': subnet['cidr'],
                   'cloud': PROVIDER,
Severity: Major
Found in calplus/v1/network/drivers/openstack.py and 2 other locations - About 2 hrs to fix
calplus/v1/network/drivers/openstack.py on lines 81..89
calplus/v1/network/drivers/openstack.py on lines 97..105

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_show_unable_to_show_network(self):
        self.mock_object(
            self.fake_driver.client, 'show_subnet',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/test_client.py on lines 71..79
calplus/tests/unit/v1/compute/test_client.py on lines 113..121
calplus/tests/unit/v1/compute/test_client.py on lines 134..142
calplus/tests/unit/v1/compute/test_client.py on lines 155..163
calplus/tests/unit/v1/compute/test_client.py on lines 176..184
calplus/tests/unit/v1/compute/test_client.py on lines 272..280
calplus/tests/unit/v1/compute/test_client.py on lines 319..327
calplus/tests/unit/v1/compute/test_client.py on lines 340..348
calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 239..247
calplus/tests/unit/v1/network/drivers/test_openstack_driver.py on lines 484..493
calplus/tests/unit/v1/network/test_client.py on lines 125..133
calplus/tests/unit/v1/network/test_client.py on lines 171..179
calplus/tests/unit/v1/network/test_client.py on lines 199..207
calplus/tests/unit/v1/network/test_client.py on lines 221..229
calplus/tests/unit/v1/network/test_client.py on lines 284..292

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    def test_delete_unable_to_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_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

Severity
Category
Status
Source
Language