Showing 104 of 104 total issues
Function generate_traffic_chart
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_traffic_chart(traffic_data: list[dict], inline: bool = True) -> Graph:
"""Create a graph object from the input traffic data with pygal.
If inline is set, the chart is being passed the option to not add an XML
declaration header to the beginning of the `render()` output, so it can
be directly included in HTML code (wrapped by a `<figure>`)
- 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 reset_password
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reset_password(token):
form = PasswordResetForm()
if form.validate_on_submit():
try:
- 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 content_hook
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def content_hook():
auth_key = current_app.config.get('GIT_UPDATE_HOOK_TOKEN')
if not auth_key:
# no key configured (default) → feature not enabled
- 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 change_mac
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def change_mac():
"""As user, change the MAC address of your device.
"""
capability_or_403('mac', 'edit')
- 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 confirm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def confirm(token: str):
try:
api_result = api.confirm_email(token)
if api_result['type'] == 'pre_member':
# Email confirmation as part of the registration process
- 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 _build_row
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _build_row(self, row, parent, align, border):
""" Given a row of text, build table cells. """
tr = etree.SubElement(parent, 'tr')
tag = 'td'
if parent.tag == 'thead':
- 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 load_config_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_config_file(app, config=None):
"""Just load the config file, do nothing else"""
# default configuration
from .config import default
- 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 __post_init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __post_init__(self):
if self.empty is None:
self.empty = not bool(self.value)
if self.raw_value is None:
self.raw_value = self.value
- 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
TODO found Open
# TODO: check whether this is the correct format
- Exclude checks
TODO found Open
<!-- TODO add aria-labelledby ↓ and id ↑ -->
- Exclude checks
TODO found Open
<!-- TODO add aria-labelledby ↓ and id ↑ -->
- Exclude checks
TODO found Open
# TODO: check it will be applied without restart
- Exclude checks
TODO found Open
# TODO: Store categories, not articles
- Exclude checks
TODO found Open
# TODO test this properly: refactor external API access into service, test parsing
- Exclude checks
TODO found Open
# TODO: Find an ip not in any dormitory
- Exclude checks
TODO found Open
<!-- TODO Fix visibility -->
- Exclude checks
XXX found Open
bic="OSDD DE 81 XXX",
- Exclude checks
TODO found Open
# TODO introduce properties once they can be excluded
- Exclude checks
TODO found Open
# TODO: mock out mail sending and check for `success` instead
- Exclude checks
TODO found Open
# TODO actually is not None due to post_init. More elegantly solved with
- Exclude checks