Showing 207 of 457 total issues
Function index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index():
editable_html_obj = EditableHTML.get_editable_html('contact')
if editable_html_obj is False:
edit = EditableHTML(editor_name='contact', page_name='Contact', 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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return render_template('account/reset_password.html', form=form)
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return redirect(url_for('single_resource.index'))
Avoid too many return
statements within this function. Open
return render_template('bulk_resource/set_descriptor_types.html',
Avoid too many return
statements within this function. Open
return render_template('bulk_resource/save.html', form=form)
Avoid too many return
statements within this function. Open
return jsonify(redirect=url_for('bulk_resource.set_descriptor_types'))
Avoid too many return
statements within this function. Open
return redirect(url_for('bulk_resource.save_csv'))
Avoid too many return
statements within this function. Open
return render_template(
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return jsonify({
Avoid too many return
statements within this function. Open
return jsonify({
Avoid too many return
statements within this function. Open
return render_template(
Avoid too many return
statements within this function. Open
return redirect(url_for('main.index'))
Avoid too many return
statements within this function. Open
return render_template('account/join_invite.html', form=form)
Avoid too many return
statements within this function. Open
return jsonify({
Function login
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def login():
"""Log in an existing user."""
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(email=form.email.data).first()
- 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 makeResponsive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function makeResponsive() {
setInitialZoom();
// Change to a single column view
if ($(window).width() <= singleColNoSpaceBreakpoint) {
- 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"