xlab-si/xopera-opera

View on GitHub

Showing 99 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 validate_service_template has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      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

      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

      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 1
        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 0
            Severity: Major
            Found in src/opera/commands/notify.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 1
                Severity: Major
                Found in src/opera/commands/deploy.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

                    Avoid too many return statements within this function.
                    Open

                            return 1
                    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 rel.template.properties[prop].eval(self, prop)
                        Severity: Major
                        Found in src/opera/instance/relationship.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 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 1
                                Severity: Major
                                Found in src/opera/commands/deploy.py - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language