Showing 66 of 168 total issues
Function drawBarChart
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawBarChart (chart, chartConfig, sizes, data, xScale, yScale) {
Function render_application_transfer_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_application_transfer_message(
Function test_crudevent_has_matching_property
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_crudevent_has_matching_property(
Function test_crudevent_property_contains
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_crudevent_property_contains(
Function Style
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def Style(name, font='Helvetica', size=12, leading=None, color=colors.black):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, *args, files=None, validate=False,
Function getCookie
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getCookie: function(name) {
var cookieValue = null;
if (document.cookie && document.cookie !== '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **kwargs):
now = timezone.now()
oldest_allowed_submission_date = now - timedelta(days=30)
for org in Organization.objects.all():
latest_login = User.objects.filter(
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **kwargs):
filename = '/tmp/database_export.csv'
with open(filename, 'w') as csvfile:
writer = csv.writer(
csvfile,
- 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 get_display_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_display_value(self, strftime_format=None):
value = super().get_display_value(strftime_format=strftime_format)
if value:
local_now = timezone.now()
time_delta = local_now - self.get_current_value()
- 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 get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(self, request, *args, **kwargs):
try:
self.app_ids = query_params.get_ids_from_query_params(request)
except InvalidQueryParamsError as err:
return not_allowed(request)
- 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
Avoid too many return
statements within this function. Open
return Response(data=updated_tags, status=201)
Avoid too many return
statements within this function. Open
return self.request_valid(request, *args, **kwargs)
Function update_tags_for_submission
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_tags_for_submission(user_id, submission_id, tags_input_string):
"""Updates the set of tags tied to a submission.
Returns the updated set of tags tag names for the submission
"""
- 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 init_templates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def init_templates(self):
if not jinja.env:
raise JinjaNotInitializedError(
"the jinja environment has not been initialized")
for key, value in self.template_and_path_args.items():
- 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 notify_applicant
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def notify_applicant(self, unsafe_data_diff):
profile = self.request.user.profile
org = profile.organization
name = safestring.mark_safe('the ' + org.name if org.slug != 'cfa' else org.name)
contact_info = safestring.mark_safe(org.get_contact_info_message())
- 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 to_representation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_representation(self, app, *args, **kwargs):
app_fields = super().to_representation(app, *args, **kwargs)
display_form, letter = get_display_form_for_csv_download(app)
data = OrderedDict(id=app.form_submission_id)
data['Link'] = app.form_submission.get_external_url()
- 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 get_context_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
self.submission = self.submissions[0]
display_form, letter_display = \
DisplayFormService.get_display_form_for_user_and_submission(
- 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 process_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_request(self, request):
if not is_a_monitoring_request(request):
referrer = request.META.get('HTTP_REFERER')
if referrer:
referrer_host = urlparse(referrer).netloc
- 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 total_display_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def total_display_data(total_app_data_by_week, year_weeks):
"""
Generate a dictionary of data suitable for our view to render total stats
across all organizations that receive applications. It includes metadata
about the organization whose stats are being displayed, a cumulative total
- 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"