hack4impact/maps4all

View on GitHub

Showing 207 of 457 total issues

Function idrefsHasCorrespondingId has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

quail.idrefsHasCorrespondingId = function( quail, test, Case ) {

  function getAttribute($element){
    var attribute = [];
    var attributeList = ['headers', 'aria-controls', 'aria-describedby', 'aria-flowto', 'aria-labelledby', 'aria-owns'];
Severity: Minor
Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

    Function documentIDsMustBeUnique has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    quail.documentIDsMustBeUnique = function(quail, test, Case) {
      test.get('$scope').each(function(){
        if($(this).children().length === 0) {
          test.add(Case({
            element: this,
    Severity: Minor
    Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

      Function languageDirectionPunctuation has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      quail.languageDirectionPunctuation = function(quail, test, Case) {
        var $scope = test.get('$scope');
        var punctuation = {};
        var punctuationRegex = /[\u2000-\u206F]|[!"#$%&'\(\)\]\[\*+,\-.\/:;<=>?@^_`{|}~]/gi;
        var currentDirection = ($scope.attr('dir')) ? $scope.attr('dir').toLowerCase() : 'ltr';
      Severity: Minor
      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

        Function doNotUseGraphicalSymbolToConveyInformation has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        quail.doNotUseGraphicalSymbolToConveyInformation = function(quail, test, Case) {
          // Passes and fails.
          test.get('$scope').find(quail.textSelector + ':not(abbr, acronym)').each(function() {
            var whiteList = '✓';
            var blackList = '?xo[]()+-!*xX';
        Severity: Minor
        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

          Function new_descriptor has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          def new_descriptor():
              """Create a new descriptor."""
              form = NewDescriptorForm()
              for i in range(10):
                  form.option_values.append_entry()
          Severity: Minor
          Found in app/descriptor/views.py - About 1 hr 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 preEvaluator has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function preEvaluator() {
              var complexInputTypes = [
                //'button', //  Defines a clickable button (mostly used with a JavaScript to activate a script)
                'checkbox', //  Defines a checkbox
                'color', // Defines a color picker
          Severity: Minor
          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

            Function colorBackgroundImageContrast has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            quail.colorBackgroundImageContrast = function (quail, test, Case, options) {
            
              var colors    = quail.components.color.colors;
              var buildCase =  quail.components.color.buildCase;
              var id        = 'colorBackgroundImageContrast';
            Severity: Minor
            Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                    if (typeof element.closingTag === 'undefined' &&
                          !element.closingTag &&
                          quail.selfClosingTags.indexOf(element.name.toLowerCase()) === -1) {
                      test.add(Case({
                        element: node,
              Severity: Critical
              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                Function headersUseToMarkSections has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                quail.headersUseToMarkSections = function(quail, test, Case) {
                  test.get('$scope').find('p').each(function() {
                    var _case = Case({
                      element: this,
                      expected: $(this).closest('.quail-test').data('expected')
                Severity: Minor
                Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                  Function focusIndicatorVisible has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  quail.focusIndicatorVisible = function(quail, test, Case) {
                    test.get('$scope').find(quail.focusElements).each(function() {
                      var _case = Case({
                        element: this,
                        expected: $(this).closest('.quail-test').data('expected')
                  Severity: Minor
                  Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                    Function isDataTable has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      isDataTable : function(table) {
                        // If there are less than three rows, why do a table?
                        if (table.find('tr').length < 3) {
                          return false;
                        }
                    Severity: Minor
                    Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                      Function findContent has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        findContent : function($element) {
                          var $topScore = $element;
                          //If an element has the ARIA role of "main," it's safe to assume that it is the main content.
                          if ($element.is('[role=main]')) {
                            return $element;
                      Severity: Minor
                      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                        Function submitCsvData has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                        Found in app/assets/scripts/upload-csv.js - About 1 hr 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 change_required_option_descriptor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def change_required_option_descriptor():
                            descriptors = Descriptor.query.all()
                            choices = []
                            for d in descriptors:
                                if d.values:
                        Severity: Minor
                        Found in app/descriptor/views.py - About 1 hr 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 aAdjacentWithSameResourceShouldBeCombined has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        quail.aAdjacentWithSameResourceShouldBeCombined = function(quail, test, Case) {
                          //var $applicableElements = test.get('$scope').find('a');
                        
                          function findAdjacent(index, element) {
                            var $element = $(element);
                        Severity: Minor
                        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                          Function getAverageRGB has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              getAverageRGB: function(img) {
                                var cacheKey = img.src;
                                if (colors.cache[cacheKey] !== undefined) {
                                  return colors.cache[cacheKey];
                                }
                          Severity: Minor
                          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                            Function initLocationSearch has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function initLocationSearch(map) {
                              var input = document.getElementById('pac-input');
                              var autocomplete = new google.maps.places.Autocomplete(input);
                              autocomplete.bindTo('bounds', map);
                            
                            
                            Severity: Minor
                            Found in app/assets/scripts/map.js - About 1 hr to fix

                              Function resolveExpectation has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              quail.components.resolveExpectation = function(element, caseID) {
                                var $scope = $(element).closest('.quail-test');
                                var expected = $scope.data('expected');
                                var result;
                                // If no caseID is supplied, assume that the expected data attribute could
                              Severity: Minor
                              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                                Function languageDirAttributeIsUsed has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                quail.languageDirAttributeIsUsed = function(quail, test, Case) {
                                
                                  var textDirection = quail.components.language.textDirection;
                                
                                  function countDirAttributes() {
                                Severity: Minor
                                Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

                                  Function createLocationMarker has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function createLocationMarker(marker_info){
                                    if (!locationMarker) {
                                        locationMarker = new google.maps.Marker({
                                          map: map,
                                          position: marker_info.location,
                                  Severity: Minor
                                  Found in app/assets/scripts/map.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language