hack4impact/maps4all

View on GitHub

Showing 207 of 457 total issues

Function edit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def edit(sugg_id):
    suggestion = Suggestion.query.get(sugg_id)
    if suggestion is None:
        abort(404)
    resource = Resource.query.get(suggestion.resource_id)
Severity: Minor
Found in app/suggestion/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 Criterion has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

quail.lib.wcag2.Criterion = (function () {

  // Provide default values for the assert objects
  function aggregateParts(parts, defaultResult) {
    var getResultPriority = quail.lib.wcag2.EarlAssertion.getResultPriority;
Severity: Major
Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

    Function Section has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function elementAttributesAreValid has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      quail.elementAttributesAreValid = function(quail, test, Case) {
          quail.components.htmlSource.getHtml(function(html, parsed) {
              if (!parsed) {
                  return;
              }
      Severity: Major
      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

        Function create has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        def create():
            """Add a resource."""
            descriptors = Descriptor.query.all()
            for descriptor in descriptors:
                if descriptor.dtype == 'option' and descriptor.values:
        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 wcag2 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        quail.lib.wcag2 = (function () {
          'use strict';
          var ajaxOpt = {async: false, dataType: 'json'};
        
          /**
        Severity: Major
        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

          Function scriptFocusIndicatorVisible has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          quail.scriptFocusIndicatorVisible = function() {
            quail.html.find(quail.focusElements).each(function() {
          
              // Preparation for test: remove focus indicators done with CSS
              var sheet, rules, rulesCache, rule;
          Severity: Major
          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

            Function scanHeaders has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function scanHeaders(tableMap, x, y, deltaX, deltaY) {
                var headerList = $();
                var cell = $(tableMap[y][x]);
                var opaqueHeaders = [];
                var inHeaderBlock;
            Severity: Major
            Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

              Function invoke has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  invoke: function () {
                    // This test is already running.
                    if (this.testComplete) {
                      throw new Error('The test ' + this.get('name') + ' is already running.');
                    }
              Severity: Major
              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                Function pNotUsedAsHeader has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function acronym has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  quail.components.acronym = function(quail, test, Case) {
                    test.get('$scope').each(function() {
                      var $scope = $(this);
                      var alreadyReported = { };
                      var predefined = { };
                  Severity: Minor
                  Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 2 hrs to fix

                    Function colorElementBehindBackgroundGradientContrast has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function predict_options has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def predict_options(self):
                              for i, column in enumerate(self.csv_header_row.csv_header_cells):
                                  if column.descriptor_type == 'option':
                                      predicted_options = set()
                                      for j in range(len(self.csv_rows)):
                      Severity: Minor
                      Found in app/models/bulk.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 colorBackgroundGradientContrast has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function step has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              step: function(row, parser) {
                                // Check CSV formatting before parsing first row
                                if (numRows == 0) {
                                  fields = row.meta.fields.map(function(e) {
                                    return e.trim();
                        Severity: Minor
                        Found in app/assets/scripts/upload-csv.js - About 1 hr to fix

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

                          quail.videoMayBePresent=function(quail, test, Case){
                          
                            var videoExtensions = ['webm', 'flv', 'ogv', 'ogg', 'avi', 'mov', 'qt', 'wmv', 'asf',
                            'mp4', 'm4p', 'm4v', 'mpg', 'mp2', 'mpeg', 'mpg', 'mpe', 'mpv', 'm2v', '3gp', '3g2'];
                            var videoHosts = ['//www.youtube.com/embed/', '//player.vimeo.com/video/'];
                          Severity: Minor
                          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

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

                            function markerListener(marker, event) {
                              $('.list-resource').removeClass('list-selected');
                              $('#map').show();
                              $('#resource-info').hide();
                            
                            
                            Severity: Minor
                            Found in app/assets/scripts/map.js - About 1 hr to fix

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

                              quail.elementsDoNotHaveDuplicateAttributes = function(quail, test, Case) {
                                quail.components.htmlSource.getHtml(function(html, parsed) {
                                  if (!parsed) {
                                    return;
                                  }
                              Severity: Minor
                              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix

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

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

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

                                    function constructor (data, testDefinitions, preconditionDefinitions, subject) {
                                      var testAggregators = [];
                                      var criterion = {};
                                      var defaultResult = data['default'] || 'untested';
                                      var id = data.id;
                                  Severity: Minor
                                  Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language