oemof/oemof-solph

View on GitHub

Showing 140 of 425 total issues

Function _evaluate_remaining_value_difference has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _evaluate_remaining_value_difference(
Severity: Major
Found in src/oemof/solph/components/experimental/_sink_dsm.py - About 50 mins to fix

    Function _evaluate_remaining_value_difference has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _evaluate_remaining_value_difference(
    Severity: Major
    Found in src/oemof/solph/components/experimental/_sink_dsm.py - About 50 mins to fix

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

          def __init__(
      Severity: Major
      Found in src/oemof/solph/components/experimental/_generic_caes.py - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for p, t in self.TIMEINDEX:
                                    self.flow[o, i, p, t].setlb(
                                        self.flows[o, i].min[t]
                                        * self.flows[o, i].nominal_value
                                    )
        Severity: Major
        Found in src/oemof/solph/_models.py - About 45 mins to fix

          Function _extract_multi_period_model_result has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def _extract_multi_period_model_result(
              model,
              df_dict,
              period_indexed=None,
              result=None,
          Severity: Minor
          Found in src/oemof/solph/processing.py - About 45 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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(
                  self,
                  label=None,
                  inputs=None,
                  outputs=None,
          Severity: Minor
          Found in src/oemof/solph/components/_link.py - About 45 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 storage_level_constraint has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def storage_level_constraint(
          Severity: Minor
          Found in src/oemof/solph/constraints/storage_level.py - About 45 mins to fix

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

                def __init__(
            Severity: Minor
            Found in src/oemof/solph/buses/_bus.py - About 45 mins to fix

              Function filter_nodes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def filter_nodes(results, option=NodeOption.All, exclude_busses=False):
                  """Get set of nodes from results-dict for given node option.
              
                  This function filters nodes from results for special needs. At the moment,
                  the following options are available:
              Severity: Minor
              Found in src/oemof/solph/views.py - About 45 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 _set_flows has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _set_flows(self):
                      """Define inflow / outflow as investment flows when they are
                      coupled with storage capacity via invest relations
                      """
                      for flow in self.inputs.values():
              Severity: Minor
              Found in src/oemof/solph/components/_generic_storage.py - About 45 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Minor
              Found in src/oemof/solph/components/_extraction_turbine_chp.py - About 45 mins to fix

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

                def _extract_multi_period_model_result(
                Severity: Minor
                Found in src/oemof/solph/processing.py - About 45 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in src/oemof/solph/_energy_system.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for p, t in self.TIMEINDEX:
                                                self.flow[o, i, p, t].setlb(0)
                                else:
                    Severity: Major
                    Found in src/oemof/solph/_models.py - About 45 mins to fix

                      Function constraint_group has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def constraint_group(self):
                              possible_approaches = ["DIW", "DLR", "oemof"]
                      
                              if not self.shed_eligibility and not self.shift_eligibility:
                                  raise ValueError(
                      Severity: Minor
                      Found in src/oemof/solph/components/experimental/_sink_dsm.py - About 45 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(
                      Severity: Minor
                      Found in src/oemof/solph/components/_offset_converter.py - About 35 mins to fix

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

                            def _inflow_share_rule(m, s, e, p, t):
                        Severity: Minor
                        Found in examples/flexible_modelling/add_constraints.py - About 35 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in src/oemof/solph/components/_converter.py - About 35 mins to fix

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

                            def equate_flows_by_keyword(
                            Severity: Minor
                            Found in src/oemof/solph/constraints/equate_flows.py - About 35 mins to fix

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

                              def limit_active_flow_count(
                              Severity: Minor
                              Found in src/oemof/solph/constraints/flow_count_limit.py - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language