Showing 139 of 424 total issues
File _sink_dsm.py
has 4619 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
Implementation of demand-side management (demand response) which allows for
File _generic_storage.py
has 1618 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -
"""
GenericStorage and associated individual constraints (blocks) and groupings.
File _investment_flow_block.py
has 957 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 investment but without nonconvex option.
File _non_convex_flow_block.py
has 730 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 nonconvex but without investment options.
Function _create
has a Cognitive Complexity of 82 (exceeds 5 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
- 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_constraints
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def _create_constraints(self):
r"""Creates all constraints for standard flows.
Depending on the attributes of the *InvestmentFlowBlock*
and *SimpleFlowBlock*, different constraints are created.
- 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 _generic_caes.py
has 574 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
In-development generic compressed air energy storage.
File processing.py
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""Modules for providing a convenient data structure for solph results.
Information about the possible usage is provided within the examples.
Function __separate_attrs
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def __separate_attrs(
system, exclude_attrs, get_flows=False, exclude_none=True
):
"""
Create a dictionary with flow scalars and series.
- 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_constraints
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def _create_constraints(self):
r"""Creates all constraints for standard flows.
The following constraints are created, if the appropriate attribute of
the *Flow* (see :class:`~oemof.solph.flows._flow.Flow`) object 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 create_nodes
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def create_nodes(nd=None):
"""Create nodes (oemof objects) from node dict
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 __init__
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
nominal_value=None,
variable_costs=0,
min=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
File _simple_flow_block.py
has 450 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 neither nonconvex nor investment options.
Function _objective_expression
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def _objective_expression(self):
r"""Objective expression for flows with investment attribute of type
class:`.Investment`. The returned costs are fixed and
investment costs. Variable costs are added from the standard flow
objective expression.
- 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 offset_diesel_genset_nonconvex_investment.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
General description
-------------------
File _models.py
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""Solph Optimization Models.
SPDX-FileCopyrightText: Uwe Krien <krien@uni-bremen.de>
File _generic_chp.py
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -
"""
GenericCHP and associated individual constraints (blocks) and groupings.
Function _add_parent_block_variables
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def _add_parent_block_variables(self):
"""Add the parent block variables, which is the `flow` variable,
indexed by FLOWS and TIMEINDEX."""
self.flow = po.Var(self.FLOWS, self.TIMEINDEX, within=po.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 _objective_expression
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def _objective_expression(self):
r"""Objective expression for all standard flows with fixed costs
and variable costs.
Depending on the attributes of the `Flow` object the following parts 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
File variable_chp.py
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
General description
-------------------