cloudcomputinghust/CAL

View on GitHub

Showing 240 of 240 total issues

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

    def __init__(self, cloud_config):
        super(OpenstackDriver, self).__init__()
        self.auth_url = cloud_config['os_auth_url']
        self.project_name = cloud_config['os_project_name']
        self.username = cloud_config['os_username']
Severity: Major
Found in calplus/v1/object_storage/drivers/openstack.py and 1 other location - About 1 day to fix
calplus/v1/compute/drivers/openstack.py on lines 22..38

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

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 __init__(self, cloud_config):
        super(OpenstackDriver, self).__init__()
        self.auth_url = cloud_config['os_auth_url']
        self.project_name = cloud_config['os_project_name']
        self.username = cloud_config['os_username']
Severity: Major
Found in calplus/v1/compute/drivers/openstack.py and 1 other location - About 1 day to fix
calplus/v1/object_storage/drivers/openstack.py on lines 18..34

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

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

File test_amazon_driver.py has 461 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" AmazonDriver for ObjectStorage
    based on BaseDriver for ObjectStorage Resource
"""

import mock
Severity: Minor
Found in calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py - About 7 hrs to fix

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

        def __init__(self, cloud_config):
            super(AmazonDriver, self).__init__()
            self.aws_access_key_id = cloud_config['aws_access_key_id']
            self.aws_secret_access_key = cloud_config['aws_secret_access_key']
            self.endpoint_url = cloud_config['endpoint_url']
    Severity: Major
    Found in calplus/v1/compute/drivers/amazon.py and 2 other locations - About 6 hrs to fix
    calplus/v1/network/drivers/amazon.py on lines 18..27
    calplus/v1/object_storage/drivers/amazon.py on lines 12..21

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

    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

        def __init__(self, cloud_config):
            super(AmazonDriver, self).__init__()
            self.aws_access_key_id = cloud_config['aws_access_key_id']
            self.aws_secret_access_key = cloud_config['aws_secret_access_key']
            self.endpoint_url = cloud_config['endpoint_url']
    Severity: Major
    Found in calplus/v1/network/drivers/amazon.py and 2 other locations - About 6 hrs to fix
    calplus/v1/compute/drivers/amazon.py on lines 20..29
    calplus/v1/object_storage/drivers/amazon.py on lines 12..21

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

    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

        def __init__(self, cloud_config):
            super(AmazonDriver, self).__init__()
            self.aws_access_key_id = cloud_config['aws_access_key_id']
            self.aws_secret_access_key = cloud_config['aws_secret_access_key']
            self.endpoint_url = cloud_config['endpoint_url']
    Severity: Major
    Found in calplus/v1/object_storage/drivers/amazon.py and 2 other locations - About 6 hrs to fix
    calplus/v1/compute/drivers/amazon.py on lines 20..29
    calplus/v1/network/drivers/amazon.py on lines 18..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 107.

    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

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

    """ OpenstackDriver for Compute
        based on BaseDriver for Compute Resource
    """
    
    
    
    Severity: Minor
    Found in calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py - About 5 hrs to fix

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

      """ OpenstackDriver for Network
          based on BaseDriver for Network Resource
      """
      
      
      
      Severity: Minor
      Found in calplus/tests/unit/v1/network/drivers/test_openstack_driver.py - About 5 hrs to fix

        File test_amazon_driver.py has 393 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """ AmazonDriver for Network
            based on BaseDriver for Network Resource
        """
        
        
        
        Severity: Minor
        Found in calplus/tests/unit/v1/network/drivers/test_amazon_driver.py - About 5 hrs to fix

          File test_amazon_driver.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """ AmazonDriver for Compute
              based on BaseDriver for Compute Resource
          """
          
          
          
          Severity: Minor
          Found in calplus/tests/unit/v1/compute/drivers/test_amazon_driver.py - About 4 hrs to fix

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

            Severity: Major
            Found in calplus/conf/block_storage.py and 3 other locations - About 4 hrs to fix
            calplus/conf/compute.py on lines 0..24
            calplus/conf/network.py on lines 0..24
            calplus/conf/object_storage.py on lines 0..24

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

            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

            Severity: Major
            Found in calplus/conf/object_storage.py and 3 other locations - About 4 hrs to fix
            calplus/conf/block_storage.py on lines 0..24
            calplus/conf/compute.py on lines 0..24
            calplus/conf/network.py on lines 0..24

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

            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

            Severity: Major
            Found in calplus/conf/network.py and 3 other locations - About 4 hrs to fix
            calplus/conf/block_storage.py on lines 0..24
            calplus/conf/compute.py on lines 0..24
            calplus/conf/object_storage.py on lines 0..24

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

            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

            Severity: Major
            Found in calplus/conf/compute.py and 3 other locations - About 4 hrs to fix
            calplus/conf/block_storage.py on lines 0..24
            calplus/conf/network.py on lines 0..24
            calplus/conf/object_storage.py on lines 0..24

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

            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_copy_object_in_another_container_successfully(self):
                    self.mock_object(
                        self.fake_driver.client, 'copy_object',
                        mock.Mock(return_value=fake_copy_object_resp)
                    )
            calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 460..477

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

            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_copy_object_in_same_container_successfully(self):
                    self.mock_object(
                        self.fake_driver.client, 'copy_object',
                        mock.Mock(return_value=fake_copy_object_resp)
                    )
            calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py on lines 481..498

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

            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

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

            """OpenstackDriver for ObjectStorage
            based on BaseDriver for ObjectStorage Resource
            """
            
            
            Severity: Minor
            Found in calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py - About 4 hrs to fix

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

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

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

                    def list_public_ip(self, **search_opts):
                        """
                
                        :param search_opts:
                        :return: list PublicIP
                Severity: Major
                Found in calplus/v1/network/drivers/amazon.py and 1 other location - About 4 hrs to fix
                calplus/v1/network/drivers/openstack.py on lines 168..182

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

                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 list_public_ip(self, **search_opts):
                        """
                
                        :param search_opts:
                        :return: list PublicIP
                Severity: Major
                Found in calplus/v1/network/drivers/openstack.py and 1 other location - About 4 hrs to fix
                calplus/v1/network/drivers/amazon.py on lines 129..143

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

                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