HackAssistant/registration

View on GitHub

Showing 69 of 274 total issues

Avoid too many return statements within this function.
Open

        return HttpResponseRedirect(reverse('review'))
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.is_hacker() or self.request.user.is_volunteer() or self.request.user.is_mentor()
    Severity: Major
    Found in user/mixins.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 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 None
          Severity: Major
          Found in checkin/views.py - About 30 mins to fix

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

                def clean(self):
                    cleaned_data = super(OverwriteOnlyModelFormMixin, self).clean()
                    c_cl_data = cleaned_data.copy()
                    for field in c_cl_data.keys():
                        if self.prefix is not None:
            Severity: Minor
            Found in app/mixins.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def handle(self, *args, **options):
            
                    with open(options['csv_filename']) as csv_f:
                        for row in csv.reader(csv_f):
                            name = row[0]
            Severity: Minor
            Found in checkin/management/commands/add_volunteers.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                def post(self, request, *args, **kwargs):
                    form = forms.SponsorForm(request.POST, request.FILES)
                    try:
                        uid = force_text(urlsafe_base64_decode(self.kwargs.get('uid', None)))
                        user = userModels.User.objects.get(pk=uid)
            Severity: Minor
            Found in applications/views.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function hacker_tabs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def hacker_tabs(user):
                app = getattr(user, 'application', None)
                tabs_list = [('Home', reverse('dashboard'),
                              'Invited' if app and user.application.needs_action() else False), ]
                if user.email_verified and app and getattr(settings, 'TEAMS_ENABLED', False) and app.can_join_team():
            Severity: Minor
            Found in app/utils.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language