oemof/oemof-solph

View on GitHub

Showing 139 of 397 total issues

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

    def __init__(
Severity: Major
Found in src/oemof/solph/components/_generic_chp.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

      Avoid deeply nested control flow statements.
      Open

                              for t in self.TIMESTEPS:
                                  self.flow[o, i, 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 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

          Avoid deeply nested control flow statements.
          Open

                                  for t in self.TIMESTEPS:
                                      self.flow[o, i, t].setlb(0)
                      else:
          Severity: Major
          Found in src/oemof/solph/_models.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 __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 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 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 __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 __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

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

                      def equate_variables(model, var1, var2, factor1=1, name=None):
                      Severity: Minor
                      Found in src/oemof/solph/constraints/equate_variables.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

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

                            def equate_flows(model, flows1, flows2, factor1=1, name="equate_flows"):
                            Severity: Minor
                            Found in src/oemof/solph/constraints/equate_flows.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(
                                Severity: Minor
                                Found in src/oemof/solph/components/_link.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language