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>`)
Severity: Minor
Found in sipa/utils/graph_utils.py - About 35 mins to fix

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:
Severity: Minor
Found in sipa/blueprints/generic.py - About 35 mins to fix

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
Severity: Minor
Found in sipa/blueprints/hooks.py - About 35 mins to fix

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')
Severity: Minor
Found in sipa/blueprints/usersuite.py - About 35 mins to fix

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
Severity: Minor
Found in sipa/blueprints/register.py - About 35 mins to fix

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':
Severity: Minor
Found in sipa/utils/bootstraped_tables.py - About 25 mins to fix

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

Severity: Minor
Found in sipa/initialization.py - About 25 mins to fix

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
Severity: Minor
Found in sipa/model/fancy_property.py - About 25 mins to fix

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
Severity: Minor
Found in sipa/utils/__init__.py by fixme

TODO found
Open

                    <!-- TODO add aria-labelledby ↓ and id ↑ -->
Severity: Minor
Found in sipa/templates/base.html by fixme

TODO found
Open

                            <!-- TODO add aria-labelledby ↓ and id ↑ -->
Severity: Minor
Found in sipa/templates/base.html by fixme

TODO found
Open

    # TODO: check it will be applied without restart
Severity: Minor
Found in helpers/registry.sh by fixme

TODO found
Open

        # TODO: Store categories, not articles
Severity: Minor
Found in sipa/flatpages.py by fixme

TODO found
Open

    # TODO test this properly: refactor external API access into service, test parsing
Severity: Minor
Found in tests/blueprints/test_bp_features.py by fixme

TODO found
Open

        # TODO: Find an ip not in any dormitory
Severity: Minor
Found in tests/model/test_model.py by fixme

TODO found
Open

                    <!-- TODO Fix visibility -->
Severity: Minor
Found in sipa/templates/base.html by fixme

XXX found
Open

            bic="OSDD DE 81 XXX",
Severity: Minor
Found in sipa/model/pycroft/user.py by fixme

TODO found
Open

    # TODO introduce properties once they can be excluded
Severity: Minor
Found in sipa/model/pycroft/schema.py by fixme

TODO found
Open

        # TODO: mock out mail sending and check for `success` instead
Severity: Minor
Found in tests/blueprints/test_bp_generic.py by fixme

TODO found
Open

    # TODO actually is not None due to post_init. More elegantly solved with
Severity: Minor
Found in sipa/model/fancy_property.py by fixme
Severity
Category
Status
Source
Language