linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 417 of 417 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    Gmaps4RailsOpenlayers.prototype.clusterize = function() {
      var marker, markers_array, _i, _len, _ref;
      if (this.markers_conf.do_clustering === true) {
        if (this.markerClusterer !== null) this.clearClusterer();
        markers_array = new Array;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.openlayers.js and 1 other location - About 7 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 244..256

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 176.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method supported_set_values has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

  def supported_set_values
    @ling = current_group.lings.find(params[:id])
    @depth = @ling.depth
    @categories = current_group.categories.at_depth(@depth)
    session[:category_id] = params[:category_id] if params[:category_id]
Severity: Minor
Found in app/controllers/lings_controller.rb - About 6 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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (this.style('stroke').isUrlDefinition()) {
                    var fs = this.style('stroke').getFillStyleDefinition(this);
                    if (fs != null) ctx.strokeStyle = fs;
                }
                else if (this.style('stroke').hasValue()) {
Severity: Major
Found in public/javascripts/canvg.js and 1 other location - About 6 hrs to fix
public/javascripts/canvg.js on lines 746..754

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 168.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (this.style('fill').isUrlDefinition()) {
                    var fs = this.style('fill').getFillStyleDefinition(this);
                    if (fs != null) ctx.fillStyle = fs;
                }
                else if (this.style('fill').hasValue()) {
Severity: Major
Found in public/javascripts/canvg.js and 1 other location - About 6 hrs to fix
public/javascripts/canvg.js on lines 762..770

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 168.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function path has 166 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            this.path = function(ctx) {
                var pp = this.PathParser;
                pp.reset();

                var bb = new svg.BoundingBox();
Severity: Major
Found in public/javascripts/canvg.js - About 6 hrs to fix

    Method import! has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def import!
          # RubyProf.measure_mode = RubyProf::ALLOCATIONS
          # RubyProf.start
          reset = "\r\e[0K"
    
    
    Severity: Major
    Found in lib/group_data/importer.rb - About 6 hrs to fix

      Function support has 159 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jQuery.support = (function() {
      
          var support,
              all,
              a,
      Severity: Major
      Found in public/javascripts/jquery.js - About 6 hrs to fix

        Function Callbacks has 148 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.Callbacks = function( flags ) {
        
            // Convert flags from String-formatted to Object-formatted
            // (we check in cache first)
            flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
        Severity: Major
        Found in public/javascripts/jquery.js - About 5 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              if (child.attribute('y').hasValue()) {
                                  child.y = child.attribute('y').toPixels('y');
                              }
                              else {
                                  if (this.attribute('dy').hasValue()) y += this.attribute('dy').toPixels('y');
          Severity: Major
          Found in public/javascripts/canvg.js and 1 other location - About 5 hrs to fix
          public/javascripts/canvg.js on lines 1884..1891

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 148.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              if (child.attribute('x').hasValue()) {
                                  child.x = child.attribute('x').toPixels('x');
                              }
                              else {
                                  if (this.attribute('dx').hasValue()) y += this.attribute('dx').toPixels('x');
          Severity: Major
          Found in public/javascripts/canvg.js and 1 other location - About 5 hrs to fix
          public/javascripts/canvg.js on lines 1906..1913

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 148.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

              Identical blocks of code found in 4 locations. Consider refactoring.
              Open

                var __hasProp = Object.prototype.hasOwnProperty,
                  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.openlayers.js and 3 other locations - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.mapquest.js on lines 2..3

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 4 locations. Consider refactoring.
              Open

                var __hasProp = Object.prototype.hasOwnProperty,
                  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js and 3 other locations - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.mapquest.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.openlayers.js on lines 2..3

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 4 locations. Consider refactoring.
              Open

                var __hasProp = Object.prototype.hasOwnProperty,
                  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.bing.js and 3 other locations - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.mapquest.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.openlayers.js on lines 2..3

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 4 locations. Consider refactoring.
              Open

                var __hasProp = Object.prototype.hasOwnProperty,
                  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.mapquest.js and 3 other locations - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 2..3
              public/javascripts/gmaps4rails/gmaps4rails.openlayers.js on lines 2..3

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                        polyline = _ref[_i];
                        polyline_points = polyline.serviceObject.latLngs.getArray()[0].getArray();
                        for (_j = 0, _len2 = polyline_points.length; _j < _len2; _j++) {
                          point = polyline_points[_j];
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 1 other location - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 454..461

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
                        polygon = _ref2[_k];
                        polygon_points = polygon.serviceObject.latLngs.getArray()[0].getArray();
                        for (_l = 0, _len4 = polygon_points.length; _l < _len4; _l++) {
                          point = polygon_points[_l];
              Severity: Major
              Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 1 other location - About 4 hrs to fix
              public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 445..452

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 134.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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
                Severity
                Category
                Status
                Source
                Language