Orange-OpenSource/python-onapsdk

View on GitHub
src/onapsdk/nbi/nbi.py

Summary

Maintainability
C
1 day
Test Coverage
A
100%

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

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
"""NBI module."""
from abc import ABC
Severity: Minor
Found in src/onapsdk/nbi/nbi.py - About 5 hrs 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 __init__ has 9 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 __init__ has 8 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 create has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def create(cls,
          Severity: Minor
          Found in src/onapsdk/nbi/nbi.py - About 35 mins to fix

            Line too long (83 > 79 characters)
            Open

                            f"invariant_uuid={self.invariant_uuid}, category={self.category}, "
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (85 > 79 characters)
            Open

                                                                        "serviceSpecification")):
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (88 > 79 characters)
            Open

                                                         f"{cls.base_url}{cls.api_version}/service?"
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (97 > 79 characters)
            Open

                        service_specification_id (str, optional): service specification ID. Defaults to None.
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (86 > 79 characters)
            Open

                    return (f"ServiceSpecification(unique_id={self.unique_id}, name={self.name}, "
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (95 > 79 characters)
            Open

                                                                       (f"{cls.base_url}{cls.api_version}/"
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (97 > 79 characters)
            Open

                                                                       "Get service specifications from NBI",
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (95 > 79 characters)
            Open

                            f"customer={self.customer}, service_specification={self.service_specification}"
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (91 > 79 characters)
            Open

                            f"service_instance_name={self.service_instance_name}, state={self.state})")
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (97 > 79 characters)
            Open

                        service_specification (ServiceSpecification, optional): service specification object.
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (91 > 79 characters)
            Open

                            f"distribution_status={self.distribution_status}, version={self.version}, "
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (97 > 79 characters)
            Open

                            f"service_specification={self.service_specification}, customer={self.customer}, "
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (92 > 79 characters)
            Open

            class ServiceOrder(Nbi, WaitForFinishMixin):  # pylint: disable=too-many-instance-attributes
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (81 > 79 characters)
            Open

                    self._service_specification: ServiceSpecification = service_specification
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (85 > 79 characters)
            Open

                        f"Get service specification with {service_specification_id} ID from NBI",
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (83 > 79 characters)
            Open

                            f"description={self.description}, external_id={self.external_id}, "
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (94 > 79 characters)
            Open

                        f"{cls.base_url}{cls.api_version}/serviceSpecification/{service_specification_id}"
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (83 > 79 characters)
            Open

                                                             f"serviceOrder/{self.unique_id}"))
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (96 > 79 characters)
            Open

                            service_specification_id=service_order.get("orderItem", [{}])[0].get("service")\
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Continuation line unaligned for hanging indent
            Open

                                get("service", {}).get("name"),
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Continuation lines indentation.

            Continuation lines should align wrapped elements either vertically
            using Python's implicit line joining inside parentheses, brackets
            and braces, or using a hanging indent.
            
            When using a hanging indent these considerations should be applied:
            - there should be no arguments on the first line, and
            - further indentation should be used to clearly distinguish itself
              as a continuation line.
            
            Okay: a = (\n)
            E123: a = (\n    )
            
            Okay: a = (\n    42)
            E121: a = (\n   42)
            E122: a = (\n42)
            E123: a = (\n    42\n    )
            E124: a = (24,\n     42\n)
            E125: if (\n    b):\n    pass
            E126: a = (\n        42)
            E127: a = (24,\n      42)
            E128: a = (24,\n    42)
            E129: if (a or\n    b):\n    pass
            E131: a = (\n    42\n 24)

            Line too long (80 > 79 characters)
            Open

                def get_by_id(cls, service_specification_id: str) -> "ServiceSpecification":
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            The backslash is redundant between brackets
            Open

                            service_specification_id=service_order.get("orderItem", [{}])[0].get("service")\
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Avoid explicit line join between brackets.

            The preferred way of wrapping long lines is by using Python's
            implied line continuation inside parentheses, brackets and braces.
            Long lines can be broken over multiple lines by wrapping expressions
            in parentheses.  These should be used in preference to using a
            backslash for line continuation.
            
            E502: aaa = [123, \\n       123]
            E502: aaa = ("bbb " \\n       "ccc")
            
            Okay: aaa = [123,\n       123]
            Okay: aaa = ("bbb "\n       "ccc")
            Okay: aaa = "bbb " \\n    "ccc"
            Okay: aaa = 123  # \\

            Line too long (84 > 79 characters)
            Open

                    Service orded is finished if it's status is not ACKNOWLEDGED or IN_PROGRESS.
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (82 > 79 characters)
            Open

                        self._customer = Customer.get_by_global_customer_id(self._customer_id)
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Continuation line unaligned for hanging indent
            Open

                                .get("serviceSpecification").get("id"),
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Continuation lines indentation.

            Continuation lines should align wrapped elements either vertically
            using Python's implicit line joining inside parentheses, brackets
            and braces, or using a hanging indent.
            
            When using a hanging indent these considerations should be applied:
            - there should be no arguments on the first line, and
            - further indentation should be used to clearly distinguish itself
              as a continuation line.
            
            Okay: a = (\n)
            E123: a = (\n    )
            
            Okay: a = (\n    42)
            E121: a = (\n   42)
            E122: a = (\n42)
            E123: a = (\n    42\n    )
            E124: a = (24,\n     42\n)
            E125: if (\n    b):\n    pass
            E126: a = (\n        42)
            E127: a = (24,\n      42)
            E128: a = (24,\n    42)
            E129: if (a or\n    b):\n    pass
            E131: a = (\n    42\n 24)

            The backslash is redundant between brackets
            Open

                            service_instance_name=service_order.get("orderItem", [{}])[0].\
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Avoid explicit line join between brackets.

            The preferred way of wrapping long lines is by using Python's
            implied line continuation inside parentheses, brackets and braces.
            Long lines can be broken over multiple lines by wrapping expressions
            in parentheses.  These should be used in preference to using a
            backslash for line continuation.
            
            E502: aaa = [123, \\n       123]
            E502: aaa = ("bbb " \\n       "ccc")
            
            Okay: aaa = [123,\n       123]
            Okay: aaa = ("bbb "\n       "ccc")
            Okay: aaa = "bbb " \\n    "ccc"
            Okay: aaa = 123  # \\

            Line too long (86 > 79 characters)
            Open

                                                            (f"{self.base_url}{self.api_version}/"
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            Line too long (100 > 79 characters)
            Open

                                                               f"{cls.base_url}{cls.api_version}/serviceOrder"):
            Severity: Minor
            Found in src/onapsdk/nbi/nbi.py by pep8

            Limit all lines to a maximum of 79 characters.

            There are still many devices around that are limited to 80 character
            lines; plus, limiting windows to 80 characters makes it possible to
            have several windows side-by-side.  The default wrapping on such
            devices looks ugly.  Therefore, please limit all lines to a maximum
            of 79 characters. For flowing long blocks of text (docstrings or
            comments), limiting the length to 72 characters is recommended.
            
            Reports error E501.

            There are no issues that match your filters.

            Category
            Status