xlab-si/xopera-opera

View on GitHub

Showing 82 of 99 total issues

Function _configure_requirements has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _configure_requirements(self,
Severity: Minor
Found in src/opera/instance/node.py - About 35 mins to fix

    Function notify has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def notify(self, verbose: bool, workdir: str, trigger_name_or_event: Optional[str],
    Severity: Minor
    Found in src/opera/instance/node.py - About 35 mins to fix

      Function notify has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def notify(self, verbose: bool, workdir: str, trigger_name_or_event: Optional[str],
      Severity: Minor
      Found in src/opera/instance/topology.py - About 35 mins to fix

        Function validate_csar has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def validate_csar(csar_path: PurePath, inputs: typing.Optional[dict], storage: Storage, verbose: bool,
        Severity: Minor
        Found in src/opera/commands/validate.py - About 35 mins to fix

          Function submit_operation has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def submit_operation(self, operation, node_id, verbose, workdir, *args):
          Severity: Minor
          Found in src/opera/threading/node_executor.py - About 35 mins to fix

            Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def validate(self, verbose, workdir, num_workers=None):
                    # Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
                    # millions of node instances, we should be fine.
                    with NodeExecutor(num_workers) as executor:
                        do_validate = True
            Severity: Minor
            Found in src/opera/instance/topology.py - About 35 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 undeploy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def undeploy(self, verbose, workdir, num_workers=None):
                    # Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
                    # millions of node instances, we should be fine.
                    with NodeExecutor(num_workers) as executor:
                        do_undeploy = True
            Severity: Minor
            Found in src/opera/instance/topology.py - About 35 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 get_template has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_template(storage, workdir):
                if storage.exists("inputs"):
                    inputs = storage.read_json("inputs")
                else:
                    inputs = {}
            Severity: Minor
            Found in src/opera/utils.py - About 35 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 deploy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def deploy(self, verbose, workdir, num_workers=None):
                    # Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
                    # millions of node instances, we should be fine.
                    with NodeExecutor(num_workers) as executor:
                        do_deploy = True
            Severity: Minor
            Found in src/opera/instance/topology.py - About 35 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

            Avoid too many return statements within this function.
            Open

                                    return rel.attributes[attr].eval(self, attr)
            Severity: Major
            Found in src/opera/instance/relationship.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return "error"
              Severity: Major
              Found in src/opera/instance/topology.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return 1
                Severity: Major
                Found in src/opera/commands/notify.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return 0
                  Severity: Major
                  Found in src/opera/commands/deploy.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 0
                    Severity: Major
                    Found in src/opera/commands/deploy.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return 0
                      Severity: Major
                      Found in src/opera/commands/diff.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return 0
                        Severity: Major
                        Found in src/opera/commands/deploy.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return 0
                          Severity: Major
                          Found in src/opera/commands/undeploy.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return 1
                            Severity: Major
                            Found in src/opera/commands/notify.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return 0
                              Severity: Major
                              Found in src/opera/commands/update.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return 1
                                Severity: Major
                                Found in src/opera/commands/undeploy.py - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language