linguisticexplorer/Linguistic-Explorer

View on GitHub

Showing 282 of 417 total issues

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

            return { top: top, left: left };
    Severity: Major
    Found in public/javascripts/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return ( diff % first === 0 && diff / first >= 0 );
      Severity: Major
      Found in public/javascripts/jquery.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return i === al ?
                    siblingCheck( a, bp[i], -1 ) :
                    siblingCheck( ap[i], b, 1 );
        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(/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

                                    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(/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

                                        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();
                      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

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

                            def ensure_result_groups!
                              #Rails.logger.debug "Step 2 => #{self.class} - Perform the search"
                              return true unless self.result_groups.nil?
                              return true unless self.query.present? || self.parent_ids.present?
                              self.result_groups ||= build_result_groups(parent_and_child_lings_property_ids)
                          Severity: Minor
                          Found in app/models/search_results.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

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

                            def avg(cluster, cluster_i)
                              c1 = cluster.size > 1 ? cluster.left.key : cluster.key
                              c2 = cluster.size > 1 ? cluster.right.key : cluster.key
                              ci = cluster_i.key
                              left_size = cluster.left.size
                          Severity: Minor
                          Found in app/presenters/clustering/linkages.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 hsv_to_rgb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def hsv_to_rgb(h, s, v)
                              h_i = (h*6).to_i
                              f = h*6 - h_i
                              p = v * (1 - s)
                              q = v * (1 - f*s)
                          Severity: Minor
                          Found in app/presenters/geo_mapping.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 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 order_columns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def order_columns(fixed_array, params_array)
                                params_array = filter_default_columns params_array
                          
                                hash_fixed = positions_hash fixed_array
                                hash_params = positions_hash params_array
                          Severity: Minor
                          Found in app/models/search_results/query_adapter.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