hack4impact/maps4all

View on GitHub

Showing 207 of 457 total issues

Function write has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Tautologistics.NodeHtmlParser.HtmlBuilder.prototype.write = function(element) {
    // this._raw.push(element);
    if (this._done) {
      this.handleCallback(new Error("Writing to the builder after done() called is not allowed without a reset()"));
    }
Severity: Major
Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 4 hrs to fix

    Function submitCsvData has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function submitCsvData(numRows, rowObjects, fields) {
      // Create list of Ajax requests: first processing the fields of the CSV then
      // the rows
      var ajaxReqs = [];
      var resetOrUpdate = document.getElementById('reset').checked
    Severity: Major
    Found in app/assets/scripts/upload-csv.js - About 4 hrs to fix

      Function set_desc_values has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def set_desc_values(self):
              all_descs = self.csv_descriptors
              opt_descs = dict([(d.name, d) for d in all_descs if d.descriptor_type == 'option'])
              for row in self.csv_rows:
                  for key in row.data:
      Severity: Minor
      Found in app/models/csv.py - About 3 hrs 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 languageChangesAreIdentified has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      quail.languageChangesAreIdentified = function(quail, test, Case) {
        var $scope = test.get('$scope');
        var currentLanguage = quail.components.language.getDocumentLanguage($scope, true);
        var text, regularExpression, matches, $element, element, failed;
      
      Severity: Major
      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 3 hrs to fix

        Function WCAGGuideline has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        quail.lib.WCAGGuideline = (function () {
        
          /**
           * A Collection of Tests.
           */
        Severity: Major
        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 3 hrs to fix

          Function parseCSV has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseCSV() {
            var numRows = 0;
            var numFields = 0;
            var errorList = [];
            var rowObjects = [];
          Severity: Minor
          Found in app/assets/scripts/upload-csv.js - About 3 hrs 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 displayDetailedResourceView has 89 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function displayDetailedResourceView(marker) {
            // get descriptor information as associations
            $.get('get-associations/' + marker.resourceID).done(function(associations) {
          
              $("#map").hide();
          Severity: Major
          Found in app/assets/scripts/map.js - About 3 hrs to fix

            Function review_required_option_descriptor has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

            def review_required_option_descriptor():
                req_opt_desc_const = RequiredOptionDescriptorConstructor.query.all()[0]
                form = RequiredOptionDescriptorMissingForm()
                missing_resources = []
                resources = Resource.query.all()
            Severity: Minor
            Found in app/descriptor/views.py - About 3 hrs 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 run has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              run : function (options) {
                if (options.reset) {
                  quail.accessibilityResults = { };
                }
            
            Severity: Major
            Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 3 hrs to fix

              File resource.py has 303 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from .. import db
              from .. models import Rating
              import os
              
              
              
              Severity: Minor
              Found in app/models/resource.py - About 3 hrs to fix

                Function defineUniqueSelector has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    defineUniqueSelector: function (element) {
                      /**
                       * Indicates whether the selector string represents a unique DOM element.
                       *
                       * @param {string} selector
                Severity: Major
                Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 3 hrs to fix

                  Function parseCSV has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function parseCSV() {
                    var numRows = 0;
                    var numFields = 0;
                    var errorList = [];
                    var rowObjects = [];
                  Severity: Major
                  Found in app/assets/scripts/upload-csv.js - About 2 hrs to fix

                    Function Technique has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    quail.lib.Technique = (function () {
                    
                      /**
                       * A collection of Cases.
                       */
                    Severity: Major
                    Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                      Function traverseVisualTreeForBackground has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          traverseVisualTreeForBackground: function(element, property) {
                            if (!element.attr('data-cacheId')) {
                              element.attr('data-cacheId', 'id_' + Math.random());
                            }
                      
                      Severity: Major
                      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                        File views.py has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from flask import abort, flash, redirect, render_template, url_for, request, make_response
                        from flask.ext.login import login_required
                        from sqlalchemy.exc import IntegrityError
                        from wtforms.fields import SelectMultipleField, SelectField, TextAreaField, StringField
                        from flask_wtf.file import InputRequired
                        Severity: Minor
                        Found in app/single_resource/views.py - About 2 hrs to fix

                          Function search_resources has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def search_resources():
                              name = request.args.get('name')
                              if name is None:
                                  name = ""
                              req_options = request.args.getlist('reqoption')
                          Severity: Minor
                          Found in app/single_resource/views.py - About 2 hrs 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 download has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def download():
                              # format string or list of strings to be csv-friendly
                              def csv_friendly(str):
                                  return '\"{}\"'.format(str.replace('\"', '\"\"')) if str else ''
                          
                          
                          Severity: Minor
                          Found in app/single_resource/views.py - About 2 hrs 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 animatedGifMayBePresent has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          quail.animatedGifMayBePresent=function(quail, test, Case){
                          
                            /**
                             * Test if gif is animated
                             * Implemented from: https://gist.github.com/3012623.git
                          Severity: Major
                          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                            Function aInPHasADistinctStyle has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            quail.aInPHasADistinctStyle=function(quail, test, Case){
                            
                              /**
                               * Checks if an element has a border set
                               * @param element
                            Severity: Major
                            Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                              Function placeholder has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              quail.components.placeholder = function(quail, test, Case, options) {
                              
                                var resolve = function (element, resolution) {
                                  test.add(Case({
                                    element: element,
                              Severity: Major
                              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language