Orange-OpenSource/python-onapsdk

View on GitHub

Showing 97 of 1,318 total issues

Function add_esr_system_info has 23 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def add_esr_system_info(self,  # pylint: disable=too-many-arguments, too-many-locals
Severity: Major
Found in src/onapsdk/aai/cloud_infrastructure/cloud_region.py - About 2 hrs to fix

    File loop_instance.py has 271 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    # SPDX-License-Identifier: Apache-2.0
    """Control Loop module."""
    import json
    Severity: Minor
    Found in src/onapsdk/clamp/loop_instance.py - About 2 hrs to fix

      Function deep_load has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def deep_load(self) -> None:
              """Deep load Object informations from SDC."""
              url = (
                  f"{self.base_front_url}/sdc1/feProxy/rest/v1/"
                  "screen?excludeTypes=VFCMT&excludeTypes=Configuration"
      Severity: Minor
      Found in src/onapsdk/sdc/sdc_resource.py - About 2 hrs 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

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

      class SdcOnboardable(SDC, ABC):
          """Base class for onboardable SDC resources (Vendors, Services, ...)."""
      
          ACTION_TEMPLATE: str
          ACTION_METHOD: str
      Severity: Minor
      Found in src/onapsdk/sdc/__init__.py - About 2 hrs to fix

        Function __init__ has 18 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self,  # pylint: disable=too-many-arguments, too-many-locals
        Severity: Major
        Found in src/onapsdk/aai/business/vf_module.py - About 2 hrs to fix

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

              def create(cls,  # pylint: disable=too-many-locals
          Severity: Major
          Found in src/onapsdk/aai/cloud_infrastructure/cloud_region.py - About 2 hrs to fix

            Function __init__ has 17 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self,  # pylint: disable=too-many-locals
            Severity: Major
            Found in src/onapsdk/aai/network/site_resource.py - About 2 hrs to fix

              Function create_from_request_response has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def create_from_request_response(cls, request_response: dict) -> "VnfInstantiation":
                      """Create VNF instantiation object based on request details.
              
                      Raises:
                          ResourceNotFound: Service related with given object doesn't exist
              Severity: Minor
              Found in src/onapsdk/so/instantiation.py - About 2 hrs 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 __init__ has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def __init__(self,  # pylint: disable=too-many-arguments, too-many-locals
                               service_instance: "ServiceInstance",
                               vnf_id: str,
                               vnf_type: str,
                               in_maint: bool,
              Severity: Major
              Found in src/onapsdk/aai/business/vnf.py - About 2 hrs to fix

                File onap_service.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/usr/bin/env python3
                # -*- coding: utf-8 -*-
                # SPDX-License-Identifier: Apache-2.0
                """ONAP Service module."""
                from abc import ABC
                Severity: Minor
                Found in src/onapsdk/onap_service.py - About 2 hrs to fix

                  File complex.py has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """A&AI Complex module."""
                  from typing import Any, Dict, Iterator
                  from urllib.parse import urlencode
                  
                  from onapsdk.utils.jinja import jinja_env
                  Severity: Minor
                  Found in src/onapsdk/aai/cloud_infrastructure/complex.py - About 2 hrs to fix

                    Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self,
                    Severity: Major
                    Found in src/onapsdk/aai/cloud_infrastructure/cloud_region.py - About 2 hrs to fix

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

                          def create(cls,  # pylint: disable=too-many-arguments
                      Severity: Major
                      Found in src/onapsdk/aai/network/site_resource.py - About 2 hrs to fix

                        Function register_vim has 15 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def register_vim(cls,  # pylint: disable=too-many-arguments
                        Severity: Major
                        Found in src/onapsdk/msb/esr.py - About 1 hr to fix

                          Function instantiate_macro has 15 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def instantiate_macro(cls,
                          Severity: Major
                          Found in src/onapsdk/so/instantiation.py - About 1 hr to fix

                            Function __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(self,  # pylint: disable=too-many-arguments
                            Severity: Major
                            Found in src/onapsdk/nbi/nbi.py - About 1 hr to fix

                              Function send_message has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def send_message(cls, method: str, action: str, url: str,  # pylint: disable=too-many-locals
                                                   **kwargs) -> Union[requests.Response, None]:
                                      """
                                      Send a message to an ONAP service.
                              
                              
                              Severity: Minor
                              Found in src/onapsdk/onap_service.py - About 1 hr 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 __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(self, name: str = None, version: str = None, sdc_values: Dict[str, str] = None,  # pylint: disable=too-many-arguments
                              Severity: Major
                              Found in src/onapsdk/sdc/service.py - About 1 hr to fix

                                Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self,  # pylint: disable=too-many-arguments
                                Severity: Major
                                Found in src/onapsdk/cds/blueprint_model.py - About 1 hr to fix

                                  Function instantiate_macro has 12 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def instantiate_macro(cls,  # pylint: disable=too-many-arguments, too-many-locals
                                  Severity: Major
                                  Found in src/onapsdk/so/instantiation.py - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language