linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 282 of 417 total issues

Method result_rows has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def result_rows(parent_attr_names, child_attr_names = [])
      [].tap do |rows|
        self.results.each do |result|
          parent, child = result.parent, result.child
          next unless parent
Severity: Minor
Found in app/models/search_results/comparisons.rb - About 55 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 imSet has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

            function imSet(img, x, y, width, height, rgba, val) {
Severity: Major
Found in public/javascripts/canvg.js - About 50 mins to fix

    Function access has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        access: function( elems, key, value, exec, fn, pass ) {
    Severity: Minor
    Found in public/javascripts/jquery.js - About 45 mins to fix

      Function CLASS has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              CLASS: function( match, curLoop, inplace, result, not, isXML ) {
      Severity: Minor
      Found in public/javascripts/jquery.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( elem.id !== match[2] ) {
                                    return rootjQuery.find( selector );
                                }
        Severity: Major
        Found in public/javascripts/jquery.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ( !match ) {
                                  anyFound = found = true;
          
                              } else if ( match === true ) {
                                  continue;
          Severity: Major
          Found in public/javascripts/jquery.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for ( i = 0; (item = curLoop[i]) != null; i++ ) {
                                    if ( item ) {
                                        found = filter( item, match, i, curLoop );
                                        pass = not ^ found;
            
            
            Severity: Major
            Found in public/javascripts/jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ( !xhrCallbacks ) {
                                              xhrCallbacks = {};
                                              jQuery( window ).unload( xhrOnUnloadAbort );
                                          }
              Severity: Major
              Found in public/javascripts/jquery.js - About 45 mins to fix

                Function dirNodeCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
                Severity: Minor
                Found in public/javascripts/jquery.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if ( ret === false ) {
                                              event.preventDefault();
                                              event.stopPropagation();
                                          }
                  Severity: Major
                  Found in public/javascripts/jquery.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ( ret[r] === ret[n] ) {
                                                ret.splice(n--, 1);
                                                break;
                                            }
                    Severity: Major
                    Found in public/javascripts/jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
                                              conv2 = converters[ tmp[1] + " " + current ];
                                              if ( conv2 ) {
                                                  conv1 = converters[ conv1 ];
                                                  if ( conv1 === true ) {
                      Severity: Major
                      Found in public/javascripts/jquery.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( !anyFound ) {
                                                return [];
                                            }
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if ( !status && s.isLocal && !s.crossDomain ) {
                                                                  status = responses.text ? 200 : 404;
                                                              // IE - #1450: sometimes returns 1223 when it should be 204
                                                              } else if ( status === 1223 ) {
                                                                  status = 204;
                          Severity: Major
                          Found in public/javascripts/jquery.js - About 45 mins to fix

                            Function ATTR has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    ATTR: function( match, curLoop, inplace, result, not, isXML ) {
                            Severity: Minor
                            Found in public/javascripts/jquery.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( name.indexOf( "data-" ) === 0 ) {
                                                          name = jQuery.camelCase( name.substring(5) );
                              
                                                          dataAttr( this[0], name, data[ name ] );
                                                      }
                              Severity: Major
                              Found in public/javascripts/jquery.js - About 45 mins to fix

                                Function inspectPrefiltersOrTransports has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
                                        dataType /* internal */, inspected /* internal */ ) {
                                Severity: Minor
                                Found in public/javascripts/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if ( copyIsArray ) {
                                                          copyIsArray = false;
                                                          clone = src && jQuery.isArray(src) ? src : [];
                                  
                                                      } else {
                                  Severity: Major
                                  Found in public/javascripts/jquery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if ( name in thisCache ) {
                                                                name = [ name ];
                                                            } else {
                                                                name = name.split( " " );
                                                            }
                                    Severity: Major
                                    Found in public/javascripts/jquery.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              for ( c = 0, cl = classNames.length; c < cl; c++ ) {
                                                                  className = className.replace(" " + classNames[ c ] + " ", " ");
                                                              }
                                      Severity: Major
                                      Found in public/javascripts/jquery.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language