tuomas2/serviceform

View on GitHub
serviceform/serviceform/forms.py

Summary

Maintainability
D
2 days
Test Coverage
B
88%

Function clean has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    def clean(self):
        for key, value in self.post_data.items():
            if key.startswith('SRV_'):
                parts = key.split('_')
                if 'EXTRA' in parts:
Severity: Minor
Found in serviceform/serviceform/forms.py - About 7 hrs 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

File forms.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# (c) 2017 Tuomas Airaksinen
#
# This file is part of Serviceform.
#
Severity: Minor
Found in serviceform/serviceform/forms.py - About 7 hrs to fix

    Cyclomatic complexity is too high in method clean. (20)
    Open

        def clean(self):
            for key, value in self.post_data.items():
                if key.startswith('SRV_'):
                    parts = key.split('_')
                    if 'EXTRA' in parts:
    Severity: Minor
    Found in serviceform/serviceform/forms.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method clean. (11)
    Open

        def clean(self):
            had_values = set()
            for key, value in self.data.items():
                if key.startswith('SRV_'):
                    parts = key.split('_')
    Severity: Minor
    Found in serviceform/serviceform/forms.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function clean has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def clean(self):
            had_values = set()
            for key, value in self.data.items():
                if key.startswith('SRV_'):
                    parts = key.split('_')
    Severity: Minor
    Found in serviceform/serviceform/forms.py - About 2 hrs 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

    Cyclomatic complexity is too high in method _fetch_instances. (6)
    Open

        def _fetch_instances(self) -> None:
            categories = [self.category] if self.category else self.form.sub_items
    
            for cat1 in categories:
                for cat2 in cat1.sub_items:
    Severity: Minor
    Found in serviceform/serviceform/forms.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _fix_fields. (6)
    Open

        def _fix_fields(self) -> None:
            req = self.service_form.required_street_address
            self.fields['street_address'].required = req
            self.fields['postal_code'].required = req
            self.fields['city'].required = req
    Severity: Minor
    Found in serviceform/serviceform/forms.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method save. (6)
    Open

        def save(self):
            participant = self.instance
            with transaction.atomic():
                with_answer = {q for q in self.questions.values() if getattr(q, 'answer', None)}
                participant.questionanswer_set.exclude(question__in=with_answer).delete()
    Severity: Minor
    Found in serviceform/serviceform/forms.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function _fetch_instances has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _fetch_instances(self) -> None:
            categories = [self.category] if self.category else self.form.sub_items
    
            for cat1 in categories:
                for cat2 in cat1.sub_items:
    Severity: Minor
    Found in serviceform/serviceform/forms.py - About 1 hr 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, request: HttpRequest, participant: models.Participant,
    Severity: Minor
    Found in serviceform/serviceform/forms.py - About 35 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, participant: models.Participant, user: 'AbstractUser',
      Severity: Minor
      Found in serviceform/serviceform/forms.py - About 35 mins to fix

        Line too long (100 > 99 characters)
        Open

            # shuffled_data = fields.BooleanField(label=_('Shuffled data (anonymity mode)'), required=False)
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Missing whitespace around parameter equals
        Open

            def save(self, commit: bool=True):
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         category: models.Level1Category=None, post_data: 'QueryDict'=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, postdata: 'QueryDict'=None, instance: models.ServiceForm=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, postdata: 'QueryDict'=None, instance: models.ServiceForm=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def save(self, request: HttpRequest=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, *args, user: 'AbstractUser'=None, **kwargs) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def save(self, commit: bool=True):
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         post_data: 'QueryDict'=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, *args, user: 'AbstractUser'=None, **kwargs) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, postdata: 'QueryDict'=None, instance: models.ServiceForm=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         service_form: models.ServiceForm=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def __init__(self, postdata: 'QueryDict'=None, instance: models.ServiceForm=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Visually indented line with same indent as next logical line
        Open

                    and not cleaned_data.get('email')):
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Continuation lines indentation.

        Continuation lines should align wrapped elements either vertically
        using Python's implicit line joining inside parentheses, brackets
        and braces, or using a hanging indent.
        
        When using a hanging indent these considerations should be applied:
        - there should be no arguments on the first line, and
        - further indentation should be used to clearly distinguish itself
          as a continuation line.
        
        Okay: a = (\n)
        E123: a = (\n    )
        
        Okay: a = (\n    42)
        E121: a = (\n   42)
        E122: a = (\n42)
        E123: a = (\n    42\n    )
        E124: a = (24,\n     42\n)
        E125: if (\n    b):\n    pass
        E126: a = (\n        42)
        E127: a = (24,\n      42)
        E128: a = (24,\n    42)
        E129: if (a or\n    b):\n    pass
        E131: a = (\n    42\n 24)

        Missing whitespace around parameter equals
        Open

                         category: models.Level1Category=None, post_data: 'QueryDict'=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         post_data: 'QueryDict'=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         category: models.Level1Category=None, post_data: 'QueryDict'=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         service_form: models.ServiceForm=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

                         category: models.Level1Category=None, post_data: 'QueryDict'=None,
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Missing whitespace around parameter equals
        Open

            def save(self, request: HttpRequest=None) -> None:
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Don't use spaces around the '=' sign in function arguments.

        Don't use spaces around the '=' sign when used to indicate a
        keyword argument or a default parameter value, except when
        using a type annotation.
        
        Okay: def complex(real, imag=0.0):
        Okay: return magic(r=real, i=imag)
        Okay: boolean(a == b)
        Okay: boolean(a != b)
        Okay: boolean(a <= b)
        Okay: boolean(a >= b)
        Okay: def foo(arg: int = 42):
        Okay: async def foo(arg: int = 42):
        
        E251: def complex(real, imag = 0.0):
        E251: return magic(r = real, i = imag)
        E252: def complex(real, image: float=0.0):

        Continuation line over-indented for visual indent
        Open

                                .exclude(pk=self.participant.pk):
        Severity: Minor
        Found in serviceform/serviceform/forms.py by pep8

        Continuation lines indentation.

        Continuation lines should align wrapped elements either vertically
        using Python's implicit line joining inside parentheses, brackets
        and braces, or using a hanging indent.
        
        When using a hanging indent these considerations should be applied:
        - there should be no arguments on the first line, and
        - further indentation should be used to clearly distinguish itself
          as a continuation line.
        
        Okay: a = (\n)
        E123: a = (\n    )
        
        Okay: a = (\n    42)
        E121: a = (\n   42)
        E122: a = (\n42)
        E123: a = (\n    42\n    )
        E124: a = (24,\n     42\n)
        E125: if (\n    b):\n    pass
        E126: a = (\n        42)
        E127: a = (24,\n      42)
        E128: a = (24,\n    42)
        E129: if (a or\n    b):\n    pass
        E131: a = (\n    42\n 24)

        There are no issues that match your filters.

        Category
        Status