Showing 140 of 425 total issues
Function _create
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""
Create constraints for GenericCAESBlock.
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 investment_limit_per_period
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def investment_limit_per_period(model, limit=None):
r"""Set an absolute limit for the total investment costs of a
investment optimization problem for each period
of the multi-period 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
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"
Further reading
Function storage_level_constraint_example
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def storage_level_constraint_example():
es = EnergySystem(
timeindex=pd.date_range("2022-01-01", freq="1H", periods=24),
infer_last_interval=True,
)
Function main
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "storage_investment.csv")
try:
data = pd.read_csv(filename)
Function main
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "variable_chp.csv")
try:
data = pd.read_csv(filename)
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function main
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "storage_investment.csv")
try:
data = pd.read_csv(filename)
Function _create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Create a storage block for investment modeling"""
m = self.parent_block()
if group is None:
return None
Function _create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the constraints for
:class:`oemof.solph.components.experimental._extraction_turbine_chp.ExtractionTurbineCHPBlock`.
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 _check_and_set_flows
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _check_and_set_flows(om, flows, keyword):
"""Checks and sets flows if needed
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 convert_keys_to_strings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def convert_keys_to_strings(result, keep_none_type=False):
"""
Convert the dictionary keys to strings.
All (tuple) keys of the result object e.g. results[(pp1, bus1)] are
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
demand,
capacity_up,
capacity_down,
Function main
has 34 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(2020, number=len(data))
Function main
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "storage_investment.csv")
try:
data = pd.read_csv(filename)
Function main
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "storage_investment.csv")
try:
data = pd.read_csv(filename)
Function _create_variables
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _create_variables(self, group):
r"""Creates all variables for standard flows.
All *Flow* objects are indexed by a starting and ending node
:math:`(i, o)`, which is omitted in the following for the sake of
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the balance constraints for the class:`BusBlock` 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 _create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _create(self, group=None):
"""
Create constraints for GenericCHPBlock.
Parameters
Function main
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# *************************************************************************
# ********** PART 1 - Define and optimise the energy system ***************
# *************************************************************************