linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 417 of 417 total issues

Avoid too many return statements within this function.
Open

            return this.css( type, typeof size === "string" ? size : size + "px" );
Severity: Major
Found in public/javascripts/jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return;
    Severity: Major
    Found in public/javascripts/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          if (s.match(/in$/)) return this.numValue() * this.getDPI(viewPort);
      Severity: Major
      Found in public/javascripts/canvg.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return this.numValue() * (Math.PI / 180.0);
        Severity: Major
        Found in public/javascripts/canvg.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              if (s.match(/cm$/)) return this.numValue() * this.getDPI(viewPort) / 2.54;
          Severity: Major
          Found in public/javascripts/canvg.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                if (s.match(/mm$/)) return this.numValue() * this.getDPI(viewPort) / 25.4;
            Severity: Major
            Found in public/javascripts/canvg.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  if (s.match(/%$/)) return this.numValue() * svg.ViewPort.ComputeSize(viewPort);
              Severity: Major
              Found in public/javascripts/canvg.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    if (s.match(/pt$/)) return this.numValue() * this.getDPI(viewPort) * (1.0 / 72.0);
                Severity: Major
                Found in public/javascripts/canvg.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return this.numValue();
                  Severity: Major
                  Found in public/javascripts/canvg.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        if (s.match(/pc$/)) return this.numValue() * 15;
                    Severity: Major
                    Found in public/javascripts/canvg.js - About 30 mins to fix

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

                            vis.selectAll("text.rule")
                                .data(yscale.ticks(10))
                              .enter().append("svg:text")
                                .attr("class", "rule")
                      Severity: Minor
                      Found in public/javascripts/d3.phylogram.js and 1 other location - About 30 mins to fix
                      public/javascripts/d3.phylogram.js on lines 198..201

                      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 45.

                      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

                          Gmaps4RailsBing.prototype.fitBounds = function() {
                            return this.serviceObject.setView({
                              bounds: this.boundsObject
                            });
                          };
                      Severity: Minor
                      Found in public/javascripts/gmaps4rails/gmaps4rails.bing.js and 1 other location - About 30 mins to fix
                      public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 204..208

                      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 45.

                      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

                          Gmaps4RailsBing.prototype.centerMapOnUser = function() {
                            return this.serviceObject.setView({
                              center: this.userLocation
                            });
                          };
                      Severity: Minor
                      Found in public/javascripts/gmaps4rails/gmaps4rails.bing.js and 1 other location - About 30 mins to fix
                      public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 190..194

                      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 45.

                      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

                            vis.selectAll('line')
                                .data(yscale.ticks(10))
                              .enter().append('svg:line')
                                .attr('y1', 0)
                      Severity: Minor
                      Found in public/javascripts/d3.phylogram.js and 1 other location - About 30 mins to fix
                      public/javascripts/d3.phylogram.js on lines 207..210

                      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 45.

                      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 2 locations. Consider refactoring.
                      Open

                                  antecedents.each_value do |prop|
                                    prop.sort_by! {|p| p.id }
                                    parent_id = [prop,cache_by_prop_value[prop_value]].map(&:first).map(&:id).sort
                                    groups[parent_id] ||= prop.map(&:id)
                                  end
                      app/models/search_results/mappers/result_mapper_implication_double.rb on lines 32..36

                      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 32.

                      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 2 locations. Consider refactoring.
                      Open

                                  antecedents.each_value do |prop|
                                    prop.sort_by! {|p| p.id }
                                    parent_id = [prop,cache_by_prop_value[prop_value]].map(&:first).map(&:id).sort
                                    groups[parent_id] ||= prop.map(&:id)
                                  end
                      app/models/search_results/mappers/result_mapper_implication_double_ante.rb on lines 32..36

                      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 32.

                      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 build_result_groups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def self.build_result_groups(result)
                              parent_vals = LingsProperty.with_id(result.parent)
                      
                              lps_by_ling_id = vals_by_ling_id(parent_vals)
                      
                      
                      Severity: Minor
                      Found in app/models/search_results/mappers/result_mapper_clustering_hamming.rb - About 25 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

                      Method update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def update
                          @example = current_group.examples.find(params[:id])
                          authorize! :update, @example
                      
                          respond_to do |format|
                      Severity: Minor
                      Found in app/controllers/examples_controller.rb - About 25 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

                      Method too_many_for_implication? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def self.too_many_for_implication?(result)
                              ids = result.parent || result.child
                              return false if ids.empty?
                              vals = [LingsProperty.with_id(ids).first]
                              group = get_group(vals)
                      Severity: Minor
                      Found in app/models/search_results/mappers/result_mapper_implication_both.rb - About 25 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

                      Method load_stats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def load_stats(lings, plain, depth)
                          unless plain
                            lings.each do |lings_with_params|
                              # If it is a multilanguage group map each subling
                               if depth > 0
                      Severity: Minor
                      Found in app/controllers/lings_controller.rb - About 25 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

                      Severity
                      Category
                      Status
                      Source
                      Language