Showing 69 of 274 total issues
Avoid too many return
statements within this function. Open
return self.request.user.has_sponsor_access
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return self.request.user.has_volunteer_access
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()
Avoid too many return
statements within this function. Open
return HttpResponseRedirect(reverse('review'))
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)
- Read upRead up
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():
- Read upRead up
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]
- Read upRead up
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 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:
- Read upRead up
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"