HackAssistant/registration

View on GitHub

Showing 69 of 274 total issues

Function post has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def post(self, request, *args, **kwargs):

        if request.POST.get('create', None):
            team = models.Team()
            team.user = request.user
Severity: Minor
Found in teams/views.py - About 45 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 reimbursement_create has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def reimbursement_create(sender, instance, created, *args, **kwargs):
Severity: Minor
Found in reimbursement/signals.py - About 35 mins to fix

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

    def user_organizer(sender, instance, created, *args, **kwargs):
    Severity: Minor
    Found in user/signals.py - About 35 mins to fix

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

      def render_mail(template_prefix, recipient_email, substitutions,
      Severity: Minor
      Found in app/emails.py - About 35 mins to fix

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

        def clean_draft_application(sender, instance, created, *args, **kwargs):
        Severity: Minor
        Found in applications/signals.py - About 35 mins to fix

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

          def user_verify_email(sender, instance, created, *args, **kwargs):
          Severity: Minor
          Found in user/signals.py - About 35 mins to fix

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

            def reimbursement_unexpire(sender, instance, created, *args, **kwargs):
            Severity: Minor
            Found in reimbursement/signals.py - About 35 mins to fix

              Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(self, *args, **kwargs):
                      super(BaseApplication, self).__init__(*args, **kwargs)
                      try:
                          dict = args[0]['dict']
                      except Exception:
              Severity: Minor
              Found in applications/models.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 post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def post(self, request, *args, **kwargs):
                      ids = request.POST.getlist('selected')
                      apps = models.HackerApplication.objects.filter(pk__in=ids).all()
                      mails = []
                      errors = 0
              Severity: Minor
              Found in organizers/views.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 attrition_rate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def attrition_rate(application_type):
                  applications = list(application_type.objects.all())
                  attended = 0
                  confirmed = 0
                  for a in applications:
              Severity: Minor
              Found in stats/views.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 post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def post(self, request, *args, **kwargs):
                      ids = request.POST.getlist('selected')
                      apps = models.HackerApplication.objects.filter(user__team__team_code__in=ids).all()
                      mails = []
                      errors = 0
              Severity: Minor
              Found in organizers/views.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 get_fields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_fields(self):
                      result = self.get_bootstrap_field_info()
                      for list_fields in result.values():
                          sum = 0
                          for field in list_fields.get('fields'):
              Severity: Minor
              Found in app/mixins.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

              Avoid too many return statements within this function.
              Open

                      return HttpResponseRedirect(reverse('sponsor_dashboard'))
              Severity: Major
              Found in app/views.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return HttpResponseRedirect(reverse('dashboard'))
                Severity: Major
                Found in app/views.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return self.request.user.has_dubious_access
                  Severity: Major
                  Found in user/mixins.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return None
                    Severity: Major
                    Found in organizers/models.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return self.request.user.has_mentor_access
                      Severity: Major
                      Found in user/mixins.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return HttpResponseRedirect(reverse('check_in_list'))
                        Severity: Major
                        Found in app/views.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return HttpResponseRedirect(reverse('root'))
                          Severity: Major
                          Found in user/views.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return None
                            Severity: Major
                            Found in checkin/views.py - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language