Showing 50 of 22,315 total issues
Avoid too many return
statements within this function. Open
return HttpResponseServerError(reason=str(e))
Avoid too many return
statements within this function. Open
return HttpResponseForbidden("allowed only via POST")
Avoid too many return
statements within this function. Open
return JsonResponse({"data": return_data})
Avoid too many return
statements within this function. Open
return HttpResponseForbidden("allowed only via POST")
Function loadMoreCivis
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadMoreCivis: function(e) {
var $target = $(e.currentTarget);
var type = $target.data('civi-type');
var limit, remaining;
if (this.viewRecommended) {
- 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_responses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_responses(request, thread_id, civi_id):
"""
USAGE:
This is used to get responses for a Civi
"""
- 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 drilldownCivi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
drilldownCivi: function (e) {
var target = $(e.target);
var ms_check = target.hasClass('ms-ctn') || target.hasClass('ms-sel-ctn') || target.hasClass('ms-close-btn') || target.hasClass('ms-trigger') || target.hasClass('ms-trigger-ico') || target.hasClass('ms-res-ctn') || target.hasClass('ms-sel-item') || target.hasClass('ms-res-group');
if (target.hasClass('btn') || target.hasClass('rating-button') || target.is('input') || target.is('textarea') || target.is('label') || target.hasClass('input') || ms_check) {
- 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 json_custom_parser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def json_custom_parser(obj):
"""
A custom json parser to handle json.dumps calls properly
for Decimal and Datetime data types.
"""
- 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_profile_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def clean_profile_image(self):
"""
This function is used to make sure that profile images
follow Civiwiki standards.
- 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 civi2csv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def civi2csv(request, thread_id):
"""
CSV export function. Thread ID goes in, CSV HTTP response attachment goes out.
"""
import csv
- 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"