eventoL/eventoL

View on GitHub
eventol/manager/models.py

Summary

Maintainability
F
1 wk
Test Coverage
B
80%

Try, Except, Pass detected.
Open

        except:
Severity: Info
Found in eventol/manager/models.py by bandit

File models.py has 859 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# pylint: disable=arguments-differ
# pylint: disable=too-many-lines

import datetime
import itertools
Severity: Major
Found in eventol/manager/models.py - About 2 days to fix

    Cyclomatic complexity is too high in method room_available. (7)
    Open

        @classmethod
        def room_available(cls, request, proposal,
                           event_slug, event_date,
                           error=False):
            activities_room = Activity.objects.filter(
    Severity: Minor
    Found in eventol/manager/models.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 room_available has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def room_available(cls, request, proposal,
    Severity: Minor
    Found in eventol/manager/models.py - About 35 mins to fix

      Method could be a function
      Open

          def published(self, for_user=None):
      Severity: Info
      Found in eventol/manager/models.py by pylint

      Used when a method doesn't use its bound instance, and so could be written as a function.

      Too few public methods (0/2)
      Open

          class Meta:
      Severity: Info
      Found in eventol/manager/models.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 Meta:
      Severity: Info
      Found in eventol/manager/models.py by pylint

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

      Unable to import 'ckeditor.fields'
      Open

      from ckeditor.fields import RichTextField
      Severity: Critical
      Found in eventol/manager/models.py by pylint

      Used when pylint has been unable to import a module.

      Unused argument 'for_user'
      Open

          def published(self, for_user=None):
      Severity: Minor
      Found in eventol/manager/models.py by pylint

      Used when a function or method argument is not used.

      Unable to import 'forms_builder.forms.models'
      Open

      from forms_builder.forms.models import AbstractField, AbstractForm
      Severity: Critical
      Found in eventol/manager/models.py by pylint

      Used when pylint has been unable to import a module.

      Useless super delegation in method 'save'
      Open

          def save(self, *args, **kwargs):
      Severity: Minor
      Found in eventol/manager/models.py by pylint

      Used whenever we can detect that an overridden method is useless, relying on super() delegation to do the same thing as another method from the MRO.

      No exception type(s) specified
      Open

              except:
      Severity: Minor
      Found in eventol/manager/models.py by pylint

      Used when an except clause doesn't specify exceptions type to catch.

      Unable to import 'image_cropping'
      Open

      from image_cropping import ImageCropField, ImageRatioField
      Severity: Critical
      Found in eventol/manager/models.py by pylint

      Used when pylint has been unable to import a module.

      Unable to import 'vote.models'
      Open

      from vote.models import VoteModel
      Severity: Critical
      Found in eventol/manager/models.py by pylint

      Used when pylint has been unable to import a module.

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

      class EventUserAttendanceDate(models.Model):
          created_at = models.DateTimeField(_('Created At'), auto_now_add=True)
          updated_at = models.DateTimeField(_('Updated At'), auto_now=True)
          event_user = models.ForeignKey(EventUser, verbose_name=_noop('Event User'),
                                         blank=False, null=False)
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 day to fix
      eventol/manager/models.py on lines 642..661

      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 188.

      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 AttendeeAttendanceDate(models.Model):
          created_at = models.DateTimeField(_('Created At'), auto_now_add=True)
          updated_at = models.DateTimeField(_('Updated At'), auto_now=True)
          attendee = models.ForeignKey(Attendee, verbose_name=_noop('Attendee'),
                                       blank=False, null=False)
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 day to fix
      eventol/manager/models.py on lines 466..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 188.

      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

          def save(self, *args, **kwargs):
              """
              Override default save
      
              it will add the slug field using slugify.
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 284..292

      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

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

          def save(self, *args, **kwargs):
              """
              Override default save
      
              it will add the slug field using slugify.
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 112..120

      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

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

                      or activities_room.filter(
                          start_date__range=(
                              proposal.start_date + one_second, proposal.end_date - one_second)) \
                          .exclude(pk=proposal.pk).exists() \
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 914..917

      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 42.

      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

              if activities_room.filter(
                      end_date__range=(
                          proposal.start_date + one_second, proposal.end_date - one_second)) \
                      .exclude(pk=proposal.pk).exists() \
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 921..924

      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 42.

      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

              if self.ticket is None:
                  ticket = Ticket()
                  ticket.save()
                  self.ticket = ticket
                  self.save()
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 623..627

      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 40.

      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

              if self.ticket is None:
                  ticket = Ticket()
                  ticket.save()
                  self.ticket = ticket
                  self.save()
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 441..445

      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 40.

      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

              return super() \
                  .get_queryset() \
                  .annotate(attendees_count=models.Count('attendee', distinct=True)) \
                  .annotate(last_date=models.Max('eventdate__date')) \
                  .annotate(activity_proposal_is_open=models.Case(
      Severity: Major
      Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
      eventol/manager/models.py on lines 48..60

      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 38.

      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 4 locations. Consider refactoring.
      Open

          time_availability = models.CharField(_('Time Availability'),
                                               max_length=200, blank=True,
                                               null=True,
                                               help_text=_('Time period in which you can \
      Severity: Major
      Found in eventol/manager/models.py and 3 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 494..496
      eventol/manager/models.py on lines 508..510
      eventol/manager/models.py on lines 601..602

      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 32.

      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 4 locations. Consider refactoring.
      Open

          additional_info = models.CharField(_('Additional Info'), max_length=200, blank=True, null=True,
                                             help_text=_('Additional info you consider \
      Severity: Major
      Found in eventol/manager/models.py and 3 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 494..496
      eventol/manager/models.py on lines 498..501
      eventol/manager/models.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 32.

      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 4 locations. Consider refactoring.
      Open

          additional_info = models.CharField(_('Additional Info'), max_length=200,
                                             blank=True, null=True,
                                             help_text=_('Additional info you consider relevant'))
      Severity: Major
      Found in eventol/manager/models.py and 3 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 494..496
      eventol/manager/models.py on lines 498..501
      eventol/manager/models.py on lines 601..602

      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 32.

      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 4 locations. Consider refactoring.
      Open

          assignation = models.CharField(_('Assignation'), max_length=200,
                                         blank=True, null=True,
                                         help_text=_('Anything you can help with \
      Severity: Major
      Found in eventol/manager/models.py and 3 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 498..501
      eventol/manager/models.py on lines 508..510
      eventol/manager/models.py on lines 601..602

      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 32.

      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

          template = models.FileField(_('Template'),
                                      upload_to='templates', blank=True, null=True,
                                      help_text=_('Custom template HTML for event index page'))
      Severity: Minor
      Found in eventol/manager/models.py and 2 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 215..217
      eventol/manager/models.py on lines 821..823

      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 32.

      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

          presentation = models.FileField(_('Presentation'),
                                          upload_to='talks', blank=True, null=True,
                                          help_text=_('Material you are going to use \
      Severity: Minor
      Found in eventol/manager/models.py and 2 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 212..214
      eventol/manager/models.py on lines 215..217

      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 32.

      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

          css_custom = models.FileField(_('Custom CSS'),
                                        upload_to='custom_css', blank=True, null=True,
                                        help_text=_('Custom CSS file for event page'))
      Severity: Minor
      Found in eventol/manager/models.py and 2 other locations - About 30 mins to fix
      eventol/manager/models.py on lines 212..214
      eventol/manager/models.py on lines 821..823

      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 32.

      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.contrib.postgres.fields import JSONField should be placed before from ckeditor.fields import RichTextField
      Open

      from django.contrib.postgres.fields import JSONField
      Severity: Info
      Found in eventol/manager/models.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 ckeditor.fields import RichTextField
      Open

      from django.utils.formats import date_format
      Severity: Info
      Found in eventol/manager/models.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 ckeditor.fields import RichTextField
      Open

      from django.core.exceptions import ValidationError
      Severity: Info
      Found in eventol/manager/models.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.contrib.auth.models import User should be placed before from ckeditor.fields import RichTextField
      Open

      from django.contrib.auth.models import User
      Severity: Info
      Found in eventol/manager/models.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_lazy as _, ugettext_noop as _noop should be placed before from ckeditor.fields import RichTextField
      Open

      from django.utils.translation import ugettext_lazy as _, ugettext_noop as _noop
      Severity: Info
      Found in eventol/manager/models.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 import models should be placed before from ckeditor.fields import RichTextField
      Open

      from django.db import models
      Severity: Info
      Found in eventol/manager/models.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.urls import reverse should be placed before from ckeditor.fields import RichTextField
      Open

      from django.urls import reverse
      Severity: Info
      Found in eventol/manager/models.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.contrib import messages should be placed before from ckeditor.fields import RichTextField
      Open

      from django.contrib import messages
      Severity: Info
      Found in eventol/manager/models.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 import timezone should be placed before from ckeditor.fields import RichTextField
      Open

      from django.utils import timezone
      Severity: Info
      Found in eventol/manager/models.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