wurmlab/GeneValidator

View on GitHub

Showing 132 of 132 total issues

Method hierarchical_clusterization_2d has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def hierarchical_clusterization_2d(no_clusters = 0, distance_method = 0,
                                       vec = @values, debug = false)
      clusters = []

      if vec.length == 1
Severity: Minor
Found in lib/genevalidator/clusterization.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

Method run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def run(n = 10)
      raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
      raise unless prediction.is_a?(Query) && !prediction.raw_sequence.nil? &&
                   hits[0].is_a?(Query)

Severity: Minor
Found in lib/genevalidator/validation_duplication.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

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

    svg.append("g")
         .attr("class", "x axis")
         .attr("transform", "translate(0," + height + ")")
         .call(xAxis)
       .append("text")
Severity: Major
Found in aux/source_assets/js/plots.js and 2 other locations - About 3 hrs to fix
aux/source_assets/js/plots.js on lines 286..295
aux/source_assets/js/plots.js on lines 405..414

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

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

    svg.append("g")
        .attr("class", "x axis")
        .attr("transform", "translate(0," + height + ")")
        .call(xAxis)
      .append("text")
Severity: Major
Found in aux/source_assets/js/plots.js and 2 other locations - About 3 hrs to fix
aux/source_assets/js/plots.js on lines 405..414
aux/source_assets/js/plots.js on lines 491..500

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

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

    svg.append("g")
         .attr("class", "x axis")
         .attr("transform", "translate(0," + height + ")")
         .call(xAxis)
       .append("text")
Severity: Major
Found in aux/source_assets/js/plots.js and 2 other locations - About 3 hrs to fix
aux/source_assets/js/plots.js on lines 286..295
aux/source_assets/js/plots.js on lines 491..500

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

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 plot_align has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  GV.plot_align = function (data, target, title, footer, xTitle, yTitle, no_lines, yValues) {
    var margin = {top: 75, right: 50, bottom: 75, left: 150},
    width = 600 - margin.left - margin.right,
    height = 300 - margin.top - margin.bottom;

Severity: Major
Found in aux/source_assets/js/plots.js - About 3 hrs to fix

    File clusterization.rb has 328 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module GeneValidator
      Pair = Struct.new(:x, :y) do
        include Comparable
    
        ##
    Severity: Minor
    Found in lib/genevalidator/clusterization.rb - About 3 hrs to fix

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

            svg.append("g")
                 .attr("class", "y axis")
                 .call(yAxis)
               .append("text")
                 .attr("class", "label")
      Severity: Major
      Found in aux/source_assets/js/plots.js and 3 other locations - About 3 hrs to fix
      aux/source_assets/js/plots.js on lines 297..306
      aux/source_assets/js/plots.js on lines 416..425
      aux/source_assets/js/plots.js on lines 502..511

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

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

          svg.append("g")
               .attr("class", "y axis")
               .call(yAxis)
             .append("text")
               .attr("class", "label")
      Severity: Major
      Found in aux/source_assets/js/plots.js and 3 other locations - About 3 hrs to fix
      aux/source_assets/js/plots.js on lines 297..306
      aux/source_assets/js/plots.js on lines 502..511
      aux/source_assets/js/plots.js on lines 769..778

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

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

          svg.append("g")
               .attr("class", "y axis")
               .call(yAxis)
             .append("text")
               .attr("class", "label")
      Severity: Major
      Found in aux/source_assets/js/plots.js and 3 other locations - About 3 hrs to fix
      aux/source_assets/js/plots.js on lines 297..306
      aux/source_assets/js/plots.js on lines 416..425
      aux/source_assets/js/plots.js on lines 769..778

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

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

           svg.append("g")
               .attr("class", "y axis")
              .call(yAxis)
            .append("text")
              .attr("class", "label")
      Severity: Major
      Found in aux/source_assets/js/plots.js and 3 other locations - About 3 hrs to fix
      aux/source_assets/js/plots.js on lines 416..425
      aux/source_assets/js/plots.js on lines 502..511
      aux/source_assets/js/plots.js on lines 769..778

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

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

          def run
            n = opt[:min_blast_hits] < 10 ? 10 : opt[:min_blast_hits]
            n = 50 if n > 50
      
            raise NotEnoughHitsError if hits.length < n
      Severity: Minor
      Found in lib/genevalidator/validation_alignment.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

      Method run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def run
            raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
            raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
      
            start = Time.now
      Severity: Minor
      Found in lib/genevalidator/validation_gene_merge.rb - About 2 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

      Method run has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def run(n = 10)
            raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
            raise unless prediction.is_a?(Query) && !prediction.raw_sequence.nil? &&
                         hits[0].is_a?(Query)
      
      
      Severity: Major
      Found in lib/genevalidator/validation_duplication.rb - About 2 hrs to fix

        File validation_alignment.rb has 281 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'bio'
        require 'forwardable'
        
        require 'genevalidator/exceptions'
        require 'genevalidator/get_raw_sequences'
        Severity: Minor
        Found in lib/genevalidator/validation_alignment.rb - About 2 hrs to fix

          Function plot_simple_bars has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            GV.plot_simple_bars = function (alldata, target, title, footer, xTitle, yTitle) {
              var margin = {top: 70, right: 50, bottom: 75, left: 50},
                width = 600 - margin.left - margin.right,
                height = 500 - margin.top - margin.bottom;
          
          
          Severity: Major
          Found in aux/source_assets/js/plots.js - About 2 hrs to fix

            Method run has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def run
                  n = opt[:min_blast_hits] < 10 ? 10 : opt[:min_blast_hits]
                  n = 50 if n > 50
            
                  raise NotEnoughHitsError if hits.length < n
            Severity: Major
            Found in lib/genevalidator/validation_alignment.rb - About 2 hrs to fix

              Method hierarchical_clusterization_2d has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def hierarchical_clusterization_2d(no_clusters = 0, distance_method = 0,
                                                     vec = @values, debug = false)
                    clusters = []
              
                    if vec.length == 1
              Severity: Major
              Found in lib/genevalidator/clusterization.rb - About 2 hrs to fix

                Method hierarchical_clusterization has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def hierarchical_clusterization(no_clusters = 0, distance_method = 0,
                                                    vec = @values, debug = false)
                      clusters = []
                      vec = vec.sort
                
                
                Severity: Major
                Found in lib/genevalidator/clusterization.rb - About 2 hrs to fix

                  Method run has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def run
                        raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
                        raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
                  
                        start = Time.now
                  Severity: Minor
                  Found in lib/genevalidator/validation_gene_merge.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language