Showing 139 of 424 total issues
Function _startup_costs
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _startup_costs(self):
r"""
.. math::
\sum_{i, o \in STARTUPFLOWS} \sum_t Y_{startup}(t) \
\cdot c_{startup}
- Read upRead up
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 _shutdown_costs
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _shutdown_costs(self):
r"""
.. math::
\sum_{SHUTDOWNFLOWS} \sum_t Y_{shutdown}(t) \
\cdot c_{shutdown}
- Read upRead up
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 _inactivity_costs
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _inactivity_costs(self):
r"""
.. math::
\sum_{INACTIVITYCOSTFLOWS} \sum_t (1 - Y_{status}(t)) \
\cdot c_{inactivity}
- Read upRead up
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 meta_results
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def meta_results(om, undefined=False):
"""
Fetch some metadata from the Solver. Feel free to add more keys.
Valid keys of the resulting dictionary are: 'objective', 'problem',
- Read upRead up
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
NonConvexFlowBlock
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class NonConvexFlowBlock(ScalarBlock):
r"""
.. automethod:: _create_constraints
.. automethod:: _create_variables
.. automethod:: _create_sets
File _invest_non_convex_flow_block.py
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""Creating sets, variables, constraints and parts of the objective function
for Flow objects with both Nonconvex and Investment options.
Function _create
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the relation for the class:`Link`.
Parameters
----------
- Read upRead up
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 _old_dsm_capacity_rule_end
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _old_dsm_capacity_rule_end(block):
"""Rule definition for determining old endogenously installed
capacity to be decommissioned due to reaching its lifetime.
Investment and decommissioning periods are linked within
the constraint. The respective decommissioning period is
- Read upRead up
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 results
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def results(model, remove_last_time_point=False):
"""Create a nested result dictionary from the result DataFrame
The already rearranged results from Pyomo from the result DataFrame are
transferred into a nested dictionary of pandas objects.
- Read upRead up
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 16 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, energysystem, **kwargs):
"""Initialize a BaseModel, using its energysystem as well as
optional kwargs for specifying the timeincrement, objective_weighting
and constraint_groups."""
super().__init__()
- Read upRead up
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
File _flow.py
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
solph version of oemof.network.Edge
File _energy_system.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
solph version of oemof.network.energy_system
Function __init__
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
demand,
capacity_up,
capacity_down,
- Read upRead up
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 15 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the linear constraint for the class:`ElectricalLine`
block.
Parameters
- Read upRead up
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 main
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main(dump_and_restore=False):
# For models that need a long time to optimise, saving and loading the
# EnergySystem might be advised. By default, we do not do this here. Feel
# free to experiment with this once you understood the rest of the code.
dump_results = restore_results = dump_and_restore
Function storage_level_constraint
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def storage_level_constraint(
model,
name,
storage_component,
multiplexer_bus,
- Read upRead up
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 main
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
data = [0, 15, 30, 35, 20, 25, 27, 10, 5, 2, 15, 40, 20, 0, 0]
# create an energy system
idx = solph.create_time_index(2017, number=len(data))
Function main
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "tuple_as_label.csv")
try:
data = pd.read_csv(filename)
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _objective_expression
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _objective_expression(self):
r"""
Objective expression for storages with no investment.
Note
- Read upRead up
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"