linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 282 of 417 total issues

Function RGBColor has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function RGBColor(color_string)
{
    this.ok = false;

    // strip any leading #
Severity: Minor
Found in public/javascripts/rgbcolor.js - About 5 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 Gmaps4RailsMapquest has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4RailsMapquest = (function(_super) {

    __extends(Gmaps4RailsMapquest, _super);

    function Gmaps4RailsMapquest() {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.mapquest.js - About 5 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                if ( event.pageX == null && original.clientX != null ) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
    
    
    Severity: Critical
    Found in public/javascripts/jquery.js - About 5 hrs to fix

      File validator.rb has 364 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'csv'
      require 'progressbar'
      
      module GroupData
        class Validator
      Severity: Minor
      Found in lib/group_data/validator.rb - About 4 hrs to fix

        Function ElementBase has 116 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                svg.Element.ElementBase = function(node) {    
                    this.attributes = {};
                    this.styles = {};
                    this.children = [];
                    
        Severity: Major
        Found in public/javascripts/canvg.js - About 4 hrs to fix

          Method convert! has 111 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def convert!
          
                reset = "\r\e[0K"
                start = Time.now
          
          
          Severity: Major
          Found in lib/sswl_data/converter.rb - About 4 hrs to fix

            Function Sizzle has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Sizzle = function( selector, context, results, seed ) {
                results = results || [];
                context = context || document;
            
                var origContext = context;
            Severity: Major
            Found in public/javascripts/jquery.js - About 4 hrs to fix

              Function build has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                d3.phylogram.build = function(selector, nodes, options) {
                  options = options || {}
                  var w = options.width || d3.select(selector).style('width') || d3.select(selector).attr('width'),
                      h = options.height || d3.select(selector).style('height') || d3.select(selector).attr('height'),
                      w = parseInt(w),
              Severity: Major
              Found in public/javascripts/d3.phylogram.js - About 4 hrs to fix

                Function PathParser has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            this.PathParser = new (function(d) {
                                this.tokens = d.split(' ');
                                
                                this.reset = function() {
                                    this.i = -1;
                Severity: Major
                Found in public/javascripts/canvg.js - About 3 hrs to fix

                  File converter.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'csv'
                  
                  module SswlData
                    class Converter
                  
                  
                  Severity: Minor
                  Found in lib/sswl_data/converter.rb - About 3 hrs to fix

                    Function trigger has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        trigger: function( event, data, elem, onlyHandlers ) {
                            // Don't do events on text and comment nodes
                            if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
                                return;
                            }
                    Severity: Major
                    Found in public/javascripts/jquery.js - About 3 hrs to fix

                      Function loadXmlDoc has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              svg.loadXmlDoc = function(ctx, dom) {
                                  svg.init(ctx);
                                  
                                  var mapXY = function(p) {
                                      var e = ctx.canvas;
                      Severity: Major
                      Found in public/javascripts/canvg.js - About 3 hrs to fix

                        Class QueryAdapter has 29 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class QueryAdapter
                        
                            include SpecialSearchQueryAdapter
                        
                            attr_reader :group
                        Severity: Minor
                        Found in app/models/search_results/query_adapter.rb - About 3 hrs to fix

                          Function send has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          send: function( headers, complete ) {
                          
                                              // Get a new xhr
                                              var xhr = s.xhr(),
                                                  handle,
                          Severity: Major
                          Found in public/javascripts/jquery.js - About 3 hrs to fix

                            Function clean has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                clean: function( elems, context, fragment, scripts ) {
                                    var checkScriptType;
                            
                                    context = context || document;
                            
                            
                            Severity: Major
                            Found in public/javascripts/jquery.js - About 3 hrs to fix

                              Function animate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  animate: function( prop, speed, easing, callback ) {
                                      var optall = jQuery.speed( speed, easing, callback );
                              
                                      if ( jQuery.isEmptyObject( prop ) ) {
                                          return this.each( optall.complete, [ false ] );
                              Severity: Major
                              Found in public/javascripts/jquery.js - About 3 hrs to fix

                                Function Transform has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        svg.Transform = function(v) {    
                                            var that = this;
                                            this.Type = {}
                                        
                                            // translate
                                Severity: Major
                                Found in public/javascripts/canvg.js - About 3 hrs to fix

                                  Method convert! has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def convert!
                                  
                                        reset = "\r\e[0K"
                                        start = Time.now
                                  
                                  
                                  Severity: Minor
                                  Found in lib/sswl_data/converter.rb - 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 BoundingBox has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          svg.BoundingBox = function(x1, y1, x2, y2) { // pass in initial points if you want
                                              this.x1 = Number.NaN;
                                              this.y1 = Number.NaN;
                                              this.x2 = Number.NaN;
                                              this.y2 = Number.NaN;
                                  Severity: Major
                                  Found in public/javascripts/canvg.js - About 3 hrs to fix

                                    Function TextElementBase has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            svg.Element.TextElementBase = function(node) {
                                                this.base = svg.Element.RenderedElementBase;
                                                this.base(node);
                                                
                                                this.getGlyph = function(font, text, i) {
                                    Severity: Major
                                    Found in public/javascripts/canvg.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language