oemof/oemof-solph

View on GitHub

Showing 140 of 425 total issues

Function draw_graph has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

def draw_graph(
Severity: Major
Found in examples/excel_reader/dispatch.py - About 1 hr to fix

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

        def _evaluate_remaining_value_difference(
    Severity: Major
    Found in src/oemof/solph/flows/_investment_flow_block.py - About 1 hr to fix

      Function draw_graph has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def draw_graph(
      Severity: Major
      Found in examples/electrical/transshipment.py - About 1 hr to fix

        Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(
                self,
                nominal_value=None,
                variable_costs=0,
                min=None,
        Severity: Minor
        Found in src/oemof/solph/flows/_flow.py - About 1 hr to fix

          Function _create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def _create(self, group=None):
                  """
                  Create constraints for GenericCHPBlock.
          
                  Parameters
          Severity: Minor
          Found in src/oemof/solph/components/_generic_chp.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(
                  self,
                  label=None,
                  inputs=None,
                  outputs=None,
          Severity: Minor
          Found in src/oemof/solph/components/_generic_storage.py - About 1 hr 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 investment_limit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          def investment_limit(model, limit=None):
              r"""Set an absolute limit for the total investment costs of an investment
              optimization problem (over all periods in case of a multi-period model):
          
              .. math:: \sum_{investment\_costs} \leq limit
          Severity: Minor
          Found in src/oemof/solph/constraints/investment_limit.py - About 1 hr 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 saturating_storage_example has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def saturating_storage_example():
              # create an energy system
              idx = pd.date_range("1/1/2023", periods=100, freq="H")
              es = solph.EnergySystem(timeindex=idx, infer_last_interval=False)
          
          
          Severity: Minor
          Found in examples/flexible_modelling/saturating_storage.py - About 1 hr to fix

            Function __init__ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __init__(
                    self,
                    label=None,
                    inputs=None,
                    outputs=None,
            Severity: Minor
            Found in src/oemof/solph/components/_generic_storage.py - About 1 hr to fix

              Function optimise_scenario has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def optimise_scenario():
                  logger.define_logging()
                  datetime_index = pd.date_range(
                      "2016-01-01 00:00:00", "2016-01-01 23:00:00", freq="60min"
                  )
              Severity: Minor
              Found in examples/excel_reader/dispatch.py - About 1 hr to fix

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

                    def __init__(

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

                      def __init__(
                  Severity: Major
                  Found in src/oemof/solph/buses/experimental/_electrical_bus.py - About 1 hr to fix

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

                        def _evaluate_remaining_value_difference(
                    Severity: Major
                    Found in src/oemof/solph/components/_generic_storage.py - About 1 hr to fix

                      Function create_dataframe has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def create_dataframe(om):
                          """Create a result DataFrame with all optimization data
                      
                          Results from Pyomo are written into one common pandas.DataFrame where
                          separate columns are created for the variable index e.g. for tuples
                      Severity: Minor
                      Found in src/oemof/solph/processing.py - About 55 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 _create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _create(self, group=None):
                              """
                              Parameters
                              ----------
                              group : list
                      Severity: Minor
                      Found in src/oemof/solph/components/_generic_storage.py - About 55 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 _evaluate_remaining_value_difference has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _evaluate_remaining_value_difference(
                              self,
                              m,
                              p,
                              i,
                      Severity: Minor
                      Found in src/oemof/solph/flows/_investment_flow_block.py - About 55 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 exec_in_env has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def exec_in_env():
                          env_path = join(base_path, ".tox", "bootstrap")
                          if sys.platform == "win32":
                              bin_path = join(env_path, "Scripts")
                          else:
                      Severity: Minor
                      Found in ci/bootstrap.py - About 55 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 shared_limit has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def shared_limit(
                      Severity: Major
                      Found in src/oemof/solph/constraints/shared_limit.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/_generic_chp.py - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language