Showing 139 of 397 total issues
File variable_chp.py
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
General description
-------------------
File diesel_genset_nonconvex_investment.py
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
General description
-------------------
File _models.py
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""Solph Optimization Models.
SPDX-FileCopyrightText: Uwe Krien <krien@uni-bremen.de>
Function __init__
has 31 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
File dispatch.py
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
General description
-------------------
Function main
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
##########################################################################
# Initialize the energy system and calculate necessary parameters
##########################################################################
Function _create
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the relation for the class:`OffsetConverter`.
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 offset_converter_example
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def offset_converter_example():
##########################################################################
# Initialize the energy system and calculate necessary parameters
##########################################################################
Function net_storage_flow
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def net_storage_flow(results, node_type):
"""Calculates the net storage flow for storage models that have one
input edge and one output edge both with flows within the domain of
non-negative reals.
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""Creates the linear constraint for the class:`ConverterBlock`
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 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _create(self, group=None):
"""
Create constraints for GenericCAESBlock.
Parameters
Function __init__
has 22 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function node
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def node(results, node, multiindex=False, keep_none_type=False):
"""
Obtain results for a single node e.g. a Bus or Component.
Either a node or its label string can be passed.
- 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 _shared_constraints_for_non_convex_flows
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _shared_constraints_for_non_convex_flows(self):
r"""
.. automethod:: _startup_constraint
.. automethod:: _max_startup_constraint
- 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 21 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
inputs,
outputs,
label=None,
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Read data file
filename = os.path.join(os.getcwd(), "input_data.csv")
try:
data = pd.read_csv(filename)
Function __init__
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
timeindex=None,
timeincrement=None,
infer_last_interval=None,
- 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