cloudcomputinghust/CAL

View on GitHub

Showing 192 of 240 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

    def test_show_unable_to_show_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 3 hrs to fix
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 239..252
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 413..425
calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py on lines 437..449

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

class NetWorkDriverTest(base.TestCase):

    """Testing class for BaseDriver"""

    def setUp(self):
Severity: Major
Found in calplus/tests/unit/v1/network/drivers/test_base_driver.py and 2 other locations - About 3 hrs to fix
calplus/tests/unit/v1/compute/drivers/test_base_driver.py on lines 101..113
calplus/tests/unit/v1/object_storage/drivers/test_base_driver.py on lines 56..68

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

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

class ComputeDriverTest(base.TestCase):

    """Testing class for BaseDriver"""

    def setUp(self):
Severity: Major
Found in calplus/tests/unit/v1/compute/drivers/test_base_driver.py and 2 other locations - About 3 hrs to fix
calplus/tests/unit/v1/network/drivers/test_base_driver.py on lines 73..85
calplus/tests/unit/v1/object_storage/drivers/test_base_driver.py on lines 56..68

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

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

class ObjectStorageBaseDriverTest(base.TestCase):

    """Testing class for ObjectStorage BaseDriver"""

    def setUp(self):
calplus/tests/unit/v1/compute/drivers/test_base_driver.py on lines 101..113
calplus/tests/unit/v1/network/drivers/test_base_driver.py on lines 73..85

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

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

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

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

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

Refactorings

Further Reading

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

    def test_release_public_ip_unable_to_release(self):
        self.mock_object(
            self.fake_driver.client, 'release_address',
            mock.Mock(side_effect=ClientError(
                fake_error_code,
Severity: Major
Found in calplus/tests/unit/v1/network/drivers/test_amazon_driver.py and 1 other location - About 3 hrs to fix
calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 271..283

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

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_stat_container_failed(self):
        self.mock_object(
            self.fake_driver.client, 'head_bucket',
            mock.Mock(side_effect=ClientError(
                fake_error_code_resp,
calplus/tests/unit/v1/network/drivers/test_amazon_driver.py on lines 448..461

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

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_failed(self):
        self.mock_object(
            self.fake_driver.client,
            'delete_object',
            mock.Mock(side_effect=ClientException(
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 232..248
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 266..282

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

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_failed(self):
        self.mock_object(
            self.fake_driver.client,
            'get_object',
            mock.Mock(side_effect=ClientException(
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 266..282
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 300..316

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

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_failed(self):
        self.mock_object(
            self.fake_driver.client,
            'head_object',
            mock.Mock(side_effect=ClientException(
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 232..248
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 300..316

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

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

    def test_shutdown_unable_to_shutdown(self):
        self.mock_object(
            self.fake_driver.client.servers, 'stop',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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

    def test_show_unable_to_show(self):
        self.mock_object(
            self.fake_driver.client.servers, 'get',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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

    def test_list_nic_unable_to_list(self):
        self.mock_object(
            self.fake_driver.client.servers, 'interface_list',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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

    def test_list_ip_unable_to_delete(self):
        self.mock_object(
            self.fake_driver.client.servers, 'ips',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425

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

    def test_reboot_unable_to_reboot(self):
        self.mock_object(
            self.fake_driver.client.servers, 'reboot',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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

    def test_delete_unable_to_delete(self):
        self.mock_object(
            self.fake_driver.client.servers, 'delete',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 228..236
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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

    def test_start_unable_to_start(self):
        self.mock_object(
            self.fake_driver.client.servers, 'start',
            mock.Mock(side_effect=ClientException))

calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 142..150
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 186..194
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 207..215
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 249..257
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 417..425
calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py on lines 549..557

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 test_delete_container_failed(self):
        self.mock_object(
            self.fake_driver.client,
            'delete_container',
            mock.Mock(side_effect=ClientException(
calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py on lines 122..134

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

Severity
Category
Status
Source
Language