linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 282 of 417 total issues

Avoid deeply nested control flow statements.
Open

                        if (typeof(this.glyphs[child.unicode]) == 'undefined') this.glyphs[child.unicode] = [];
Severity: Major
Found in public/javascripts/canvg.js - About 45 mins to fix

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

                this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { 
    Severity: Minor
    Found in public/javascripts/canvg.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          else if (!set.fontSize) { if (d[i] != 'inherit') f.fontSize = d[i].split('/')[0]; set.fontStyle = set.fontVariant = set.fontWeight = set.fontSize = true; }
                          else { if (d[i] != 'inherit') ff += d[i]; }
      Severity: Major
      Found in public/javascripts/canvg.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (cssClass == '@font-face') {
                                        var fontFamily = props['font-family'].value.replace(/"/g,'');
                                        var srcs = props['src'].value.split(',');
                                        for (var s=0; s<srcs.length; s++) {
                                            if (srcs[s].indexOf('format("svg")') > 0) {
        Severity: Major
        Found in public/javascripts/canvg.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      for (var name in styles) {
                                          this.styles[name] = styles[name];
                                      }
          Severity: Major
          Found in public/javascripts/canvg.js - About 45 mins to fix

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

                        this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) {
            Severity: Minor
            Found in public/javascripts/canvg.js - About 45 mins to fix

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

                          function imGet(img, x, y, width, height, rgba) {
              Severity: Minor
              Found in public/javascripts/canvg.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    else if (!set.fontWeight && that.Weights.indexOf(d[i]) != -1) {    if (d[i] != 'inherit') f.fontWeight = d[i]; set.fontStyle = set.fontVariant = set.fontWeight = true; }
                Severity: Major
                Found in public/javascripts/canvg.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              for (var k=0; k<cssProps.length; k++) {
                                                  var prop = cssProps[k].indexOf(':');
                                                  var name = cssProps[k].substr(0, prop);
                                                  var value = cssProps[k].substr(prop + 1, cssProps[k].length - prop);
                                                  if (name != null && value != null) {
                  Severity: Major
                  Found in public/javascripts/canvg.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              session[:prop_id] = uncertain_search_space.any? ? uncertain_search_space.first.id : session[:prop_id]
                    Severity: Major
                    Found in app/controllers/lings_controller.rb - About 45 mins to fix

                      Method set has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def self.set(major, minor, patch, build)
                                current = YAML.load_file(TARGET)
                            current['major'] = major unless major.nil?
                            current['minor'] = minor unless minor.nil?
                            current['patch'] = patch unless patch.nil?
                      Severity: Minor
                      Found in app/helpers/version.rb - About 45 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

                      Consider simplifying this complex logical expression.
                      Open

                              } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                  (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
                                  !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
                      
                                  value = value.replace(rxhtmlTag, "<$1></$2>");
                      Severity: Major
                      Found in public/javascripts/jquery.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ( s.crossDomain == null ) {
                                    parts = rurl.exec( s.url.toLowerCase() );
                                    s.crossDomain = !!( parts &&
                                        ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
                                            ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
                          
                                      // Pregenerate a single jQuery object for reuse with .is()
                                      jqcur = jQuery(this);
                                      jqcur.context = this.ownerDocument || this;
                          Severity: Major
                          Found in public/javascripts/jquery.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
                                            Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
                            
                                        ret = Sizzle.find( parts.shift(), context, contextXML );
                                        context = ret.expr ?
                            Severity: Major
                            Found in public/javascripts/jquery.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                              if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
                              
                                                  // Don't re-trigger an onFOO event when we call its FOO() method
                                                  old = elem[ ontype ];
                              
                              
                              Severity: Major
                              Found in public/javascripts/jquery.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                if ( !jQuery.support.opacity ) {
                                    jQuery.cssHooks.opacity = {
                                        get: function( elem, computed ) {
                                            // IE uses filters for opacity
                                            return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
                                Severity: Major
                                Found in public/javascripts/jquery.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                            if (element === polyline[0]) {
                                              strokeColor = element.strokeColor || this.polylines_conf.strokeColor;
                                              strokeOpacity = element.strokeOpacity || this.polylines_conf.strokeOpacity;
                                              strokeWeight = element.strokeWeight || this.polylines_conf.strokeWeight;
                                              clickable = element.clickable || this.polylines_conf.clickable;
                                  Severity: Major
                                  Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 40 mins to fix

                                    Function remove has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        remove: function( elem, types, handler, selector, mappedTypes ) {
                                    Severity: Minor
                                    Found in public/javascripts/jquery.js - About 35 mins to fix

                                      Function add has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          add: function( elem, types, handler, data, selector ) {
                                      Severity: Minor
                                      Found in public/javascripts/jquery.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language