cloudcomputinghust/CAL

View on GitHub

Showing 38 of 240 total issues

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

    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

            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

                OpenstackDriverTest has 30 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/network/drivers/test_openstack_driver.py - About 3 hrs to fix

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

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

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

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

                      AmazonDriverTest has 24 functions (exceeds 20 allowed). Consider refactoring.
                      Open

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

                        OpenStackDriverTest has 22 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class OpenStackDriverTest(base.TestCase):
                            """Testing for OpenStackDriver"""
                        
                            def setUp(self):
                                super(OpenStackDriverTest, self).setUp()
                        Severity: Minor
                        Found in calplus/tests/unit/v1/object_storage/drivers/test_openstack_driver.py - About 2 hrs to fix

                          AmazonDriverTest has 22 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class AmazonDriverTest(base.TestCase):
                              """Testing class for AmazonDriver"""
                          
                              def setUp(self):
                                  super(AmazonDriverTest, self).setUp()
                          Severity: Minor
                          Found in calplus/tests/unit/v1/object_storage/drivers/test_amazon_driver.py - About 2 hrs to fix

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

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

                              OpenstackDriver has 21 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class OpenstackDriver(BaseDriver):
                                  """docstring for OpenstackDriver"""
                              
                                  def __init__(self, cloud_config):
                                      super(OpenstackDriver, self).__init__()
                              Severity: Minor
                              Found in calplus/v1/compute/drivers/openstack.py - About 2 hrs to fix

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

                                class ClientTest(base.TestCase):
                                
                                    """docstring for ClientTest"""
                                
                                    def setUp(self):
                                Severity: Minor
                                Found in calplus/tests/unit/v1/network/test_client.py - About 2 hrs to fix

                                  AmazonDriver has 21 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class AmazonDriver(BaseDriver):
                                      """docstring for AmazonDriver"""
                                  
                                      def __init__(self, cloud_config):
                                          super(AmazonDriver, self).__init__()
                                  Severity: Minor
                                  Found in calplus/v1/compute/drivers/amazon.py - About 2 hrs to fix

                                    TestClient has 21 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class TestClient(base.TestCase):
                                    
                                        """Unittest for Object Storage Client"""
                                    
                                        def setUp(self):
                                    Severity: Minor
                                    Found in calplus/tests/unit/v1/object_storage/test_client.py - About 2 hrs to fix

                                      Function append_request_id has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def append_request_id(req, resp, resource, params):
                                          """Append request id which got from response
                                          header to resource.req_ids list.
                                          """
                                          def get_headers(resp):
                                      Severity: Minor
                                      Found in calplus/utils.py - About 55 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Function create has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def create(self, image_id, flavor_id,
                                      Severity: Minor
                                      Found in calplus/v1/compute/drivers/amazon.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language