hack4impact/maps4all

View on GitHub

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='')
Severity: Minor
Found in app/contact/views.py - About 35 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

Avoid too many return statements within this function.
Open

    return true;
Severity: Major
Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return false;
    Severity: Major
    Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return render_template('account/reset_password.html', form=form)
      Severity: Major
      Found in app/account/views.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return false;
        Severity: Major
        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return redirect(url_for('single_resource.index'))
          Severity: Major
          Found in app/bulk_resource/views.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return render_template('bulk_resource/set_descriptor_types.html',
            Severity: Major
            Found in app/bulk_resource/views.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return render_template('bulk_resource/save.html', form=form)
              Severity: Major
              Found in app/bulk_resource/views.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return jsonify(redirect=url_for('bulk_resource.set_descriptor_types'))
                Severity: Major
                Found in app/bulk_resource/views.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return redirect(url_for('bulk_resource.save_csv'))
                  Severity: Major
                  Found in app/bulk_resource/views.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return render_template(
                    Severity: Major
                    Found in app/bulk_resource/views.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return True
                      Severity: Major
                      Found in app/models/user.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return jsonify({
                        Severity: Major
                        Found in app/bulk_resource/views.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return jsonify({
                          Severity: Major
                          Found in app/bulk_resource/views.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return render_template(
                            Severity: Major
                            Found in app/bulk_resource/views.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return redirect(url_for('main.index'))
                              Severity: Major
                              Found in app/account/views.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return render_template('account/join_invite.html', form=form)
                                Severity: Major
                                Found in app/account/views.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return jsonify({
                                  Severity: Major
                                  Found in app/bulk_resource/views.py - About 30 mins to fix

                                    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()
                                    Severity: Minor
                                    Found in app/account/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 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) {
                                    Severity: Minor
                                    Found in app/assets/scripts/map.js - 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