eventoL/eventoL

View on GitHub
eventol/manager/forms.py

Summary

Maintainability
F
6 days
Test Coverage
F
57%

Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
Open

    read_guidelines = forms.BooleanField(label=mark_safe(text), required=True)
Severity: Minor
Found in eventol/manager/forms.py by bandit

Potential XSS on mark_safe function.
Open

    read_guidelines = forms.BooleanField(label=mark_safe(text), required=True)
Severity: Minor
Found in eventol/manager/forms.py by bandit

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

# pylint: disable=too-many-ancestors

import datetime
import logging
import uuid
Severity: Minor
Found in eventol/manager/forms.py - About 6 hrs to fix

    Cyclomatic complexity is too high in class ContactForm. (6)
    Open

    class ContactForm(ModelForm):
        class Meta:
            model = Contact
            fields = ['type', 'url', 'text']
    
    
    Severity: Minor
    Found in eventol/manager/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 __init__. (6)
    Open

        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['username', 'email', 'email2']:
                del self.fields[field].widget.attrs['placeholder']
    
    
    Severity: Minor
    Found in eventol/manager/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. (6)
    Open

        def clean(self):
            super().clean()
            if any(self.errors):
                return
    
    
    Severity: Minor
    Found in eventol/manager/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 __init__. (6)
    Open

        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['username', 'email', 'email2', 'password1', 'password2']:
                del self.fields[field].widget.attrs['placeholder']
    
    
    Severity: Minor
    Found in eventol/manager/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. (6)
    Open

        def clean(self):
            cleaned_data = super().clean()
            data_type = cleaned_data.get("type")
            value = cleaned_data.get("url")
    
    
    Severity: Minor
    Found in eventol/manager/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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def clean(self):
            cleaned_data = super().clean()
            data_type = cleaned_data.get("type")
            value = cleaned_data.get("url")
    
    
    Severity: Minor
    Found in eventol/manager/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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['username', 'email', 'email2', 'password1', 'password2']:
                del self.fields[field].widget.attrs['placeholder']
    
    
    Severity: Minor
    Found in eventol/manager/forms.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 clean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def clean(self):
            super().clean()
            if any(self.errors):
                return
    
    
    Severity: Minor
    Found in eventol/manager/forms.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['username', 'email', 'email2']:
                del self.fields[field].widget.attrs['placeholder']
    
    
    Severity: Minor
    Found in eventol/manager/forms.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

    Too few public methods (0/2)
    Open

    class ResetPasswordKeyForm(AllAuthResetPasswordKeyForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class AttendeeAutocomplete(autocomplete.Select2QuerySetView):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (0/2)
    Open

    class ResetPasswordForm(AllAuthResetPasswordForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (0/2)
    Open

    class ChangePasswordForm(AllAuthChangePasswordForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (0/2)
    Open

    class LoginForm(AllAuthLoginForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class AllAttendeeAutocomplete(autocomplete.Select2QuerySetView):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (0/2)
    Open

    class SetPasswordForm(AllAuthSetPasswordForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class SignUpForm(AllAuthSignUpForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class SoftwareAutocomplete(autocomplete.Select2QuerySetView):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class EventUserAutocomplete(autocomplete.Select2QuerySetView):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Too few public methods (1/2)
    Open

    class SocialSignUpForm(AllAuthSocialSignUpForm):
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when class has too few public methods, so be sure it's really worth it.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import ResetPasswordForm as AllAuthResetPasswordForm
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'dal'
    Open

    from dal import autocomplete
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import \
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Access to member 'fields' before its definition line 512
    Open

                del self.fields[field].widget.attrs['placeholder']
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Unable to import 'captcha.fields'
    Open

    from captcha.fields import CaptchaField
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Access to member 'fields' before its definition line 452
    Open

                del self.fields[field].widget.attrs['placeholder']
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Access to member 'fields' before its definition line 512
    Open

            original_fields = self.fields
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import LoginForm as AllAuthLoginForm
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'tempus_dominus.widgets'
    Open

    from tempus_dominus.widgets import DatePicker, TimePicker
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import SignupForm as AllAuthSignUpForm
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import SetPasswordForm as AllAuthSetPasswordForm
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'allauth.socialaccount.forms'
    Open

    from allauth.socialaccount.forms import SignupForm as AllAuthSocialSignUpForm
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Unable to import 'image_cropping'
    Open

    from image_cropping import ImageCropWidget
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Access to member 'fields' before its definition line 452
    Open

            for field in self.fields.keys():
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Access to member 'fields' before its definition line 512
    Open

            for field in self.fields.keys():
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Unable to import 'allauth.account.forms'
    Open

    from allauth.account.forms import \
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when pylint has been unable to import a module.

    Access to member 'fields' before its definition line 452
    Open

            original_fields = self.fields
    Severity: Critical
    Found in eventol/manager/forms.py by pylint

    Used when an instance member is accessed before it's actually assigned.

    Merge this if statement with the enclosing one.
    Open

                if email != repeat_email:
    Severity: Major
    Found in eventol/manager/forms.py by sonar-python

    Merging collapsible if statements increases the code's readability.

    Noncompliant Code Example

    if condition1:
        if condition2:
            # ...
    

    Compliant Solution

    if condition1 and condition2:
        # ...
    

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class AttendeeSearchForm(forms.Form):
        def __init__(self, event_slug, *args, **kwargs):
            kwargs.update(initial={
                'event_slug': event_slug,
            })
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 7 hrs to fix
    eventol/manager/forms.py on lines 140..154

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 114.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class EventUserSearchForm(forms.Form):
        def __init__(self, event_slug, *args, **kwargs):
            kwargs.update(initial={
                'event_slug': event_slug,
            })
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 7 hrs to fix
    eventol/manager/forms.py on lines 121..136

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 114.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

            if event_user and self.q:
                attendees = attendees.filter(
                    Q(first_name__unaccent__icontains=self.q) |
                    Q(last_name__unaccent__icontains=self.q) |
                    Q(nickname__unaccent__icontains=self.q) |
    Severity: Major
    Found in eventol/manager/forms.py and 2 other locations - About 3 hrs to fix
    eventol/manager/forms.py on lines 66..71
    eventol/manager/forms.py on lines 111..116

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 72.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

            if event_user and self.q:
                event_users = event_users.filter(
                    Q(user__first_name__unaccent__icontains=self.q) |
                    Q(user__last_name__unaccent__icontains=self.q) |
                    Q(user__username__unaccent__icontains=self.q) |
    Severity: Major
    Found in eventol/manager/forms.py and 2 other locations - About 3 hrs to fix
    eventol/manager/forms.py on lines 66..71
    eventol/manager/forms.py on lines 84..89

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 72.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

            if event_user and self.q:
                attendees = attendees.filter(
                    Q(first_name__unaccent__icontains=self.q) |
                    Q(last_name__unaccent__icontains=self.q) |
                    Q(nickname__unaccent__icontains=self.q) |
    Severity: Major
    Found in eventol/manager/forms.py and 2 other locations - About 3 hrs to fix
    eventol/manager/forms.py on lines 84..89
    eventol/manager/forms.py on lines 111..116

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 72.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class ResetPasswordKeyForm(AllAuthResetPasswordKeyForm):
        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['password1', 'password2']:
                del self.fields[field].widget.attrs['placeholder']
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 2 hrs to fix
    eventol/manager/forms.py on lines 481..485

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 53.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class SetPasswordForm(AllAuthSetPasswordForm):
        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            for field in ['password1', 'password2']:
                del self.fields[field].widget.attrs['placeholder']
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 2 hrs to fix
    eventol/manager/forms.py on lines 467..471

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 53.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class AttendeeRegistrationByCollaboratorForm(forms.ModelForm):
        class Meta:
            model = Attendee
            fields = ['first_name', 'last_name', 'nickname', 'email',
                      'additional_info', 'is_installing',
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 263..270

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 46.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        class Meta:
            model = Attendee
            fields = ['first_name', 'last_name', 'nickname', 'email',
                      'additional_info', 'is_installing',
                      'event', 'registration_date']
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 158..166

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 46.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def signup(self, request, user):
            user.first_name = self.cleaned_data['first_name']
            user.last_name = self.cleaned_data['last_name']
            user.save()
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 514..517

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def signup(self, request, user):
            user.first_name = self.cleaned_data['first_name']
            user.last_name = self.cleaned_data['last_name']
            user.save()
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 454..457

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            for field in self.fields.keys():
                if field not in self.ordered_field_names:
                    new_fields[field] = original_fields.get(field)
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 448..450

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 41.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            for field in self.fields.keys():
                if field not in self.ordered_field_names:
                    new_fields[field] = original_fields.get(field)
    Severity: Major
    Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
    eventol/manager/forms.py on lines 508..510

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 41.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            attended = [attendance_date.attendee.pk for attendance_date in
                        AttendeeAttendanceDate.objects.filter(
                            attendee__event__event_slug=event_slug,
                            date__date=datetime.date.today())]
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 50 mins to fix
    eventol/manager/forms.py on lines 103..106

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            attended = [attendance_date.event_user.pk for attendance_date in
                        EventUserAttendanceDate.objects.filter(
                            event_user__event__event_slug=event_slug,
                            date__date=datetime.date.today())]
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 50 mins to fix
    eventol/manager/forms.py on lines 58..61

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                self.fields['start_date'].widget.attrs.update({'id': uuid.uuid4().hex.lower()})
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 45 mins to fix
    eventol/manager/forms.py on lines 219..219

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 35.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                self.fields['end_date'].widget.attrs.update({'id': uuid.uuid4().hex.lower()})
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 45 mins to fix
    eventol/manager/forms.py on lines 218..218

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 35.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            for field_name in self.ordered_field_names:
                field = original_fields.get(field_name)
                if field:
                    new_fields[field_name] = field
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 40 mins to fix
    eventol/manager/forms.py on lines 443..446

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 34.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            for field_name in self.ordered_field_names:
                field = original_fields.get(field_name)
                if field:
                    new_fields[field_name] = field
    Severity: Minor
    Found in eventol/manager/forms.py and 1 other location - About 40 mins to fix
    eventol/manager/forms.py on lines 503..506

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 34.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    third party import from django.utils.safestring import mark_safe should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.utils.safestring import mark_safe
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.forms import Form should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.forms import Form
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.forms.formsets import DELETION_FIELD_NAME should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.forms.formsets import DELETION_FIELD_NAME
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.forms.models import BaseModelFormSet, ModelForm should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.forms.models import BaseModelFormSet, ModelForm
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.core.validators import URLValidator, validate_email should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.core.validators import URLValidator, validate_email
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.core.exceptions import ValidationError should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.core.exceptions import ValidationError
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.db.models.query_utils import Q should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.db.models.query_utils import Q
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.utils.formats import date_format should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.utils.formats import date_format
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django.utils.translation import ugettext as _ should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django.utils.translation import ugettext as _
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    third party import from django import forms should be placed before from allauth.account.forms import ChangePasswordForm as AllAuthChangePasswordForm
    Open

    from django import forms
    Severity: Info
    Found in eventol/manager/forms.py by pylint

    Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

    There are no issues that match your filters.

    Category
    Status