Showing 139 of 397 total issues
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)
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"
)
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
label=None,
inputs=None,
outputs=None,
Function plot_partload
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot_partload(self, bus, tstep):
"""Create a matplotlib figure of the flow to nonconvex flow relation.
Parameters
----------
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _evaluate_remaining_value_difference
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _evaluate_remaining_value_difference(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, energysystem, discount_rate=None, **kwargs):
super().__init__()
# Check root logger. Due to a problem with pyomo the building of the
# model will take up to a 100 times longer if the root logger is set
- 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 normed_offset_and_conversion_factors_from_coefficients
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def normed_offset_and_conversion_factors_from_coefficients(
self, coefficients
):
"""
Calculate slope and offset for new API from the old API coefficients.
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def _create(self, group=None):
"""
Parameters
----------
group : list
- 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_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
- 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_time_index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_time_index(
year: int = None,
interval: float = 1,
number: int = None,
start: datetime.date = 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 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:
- 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 _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,
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _evaluate_remaining_value_difference
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _evaluate_remaining_value_difference(
Function shared_limit
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def shared_limit(
Function generic_integral_limit
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def generic_integral_limit(
Function _evaluate_remaining_value_difference
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _evaluate_remaining_value_difference(