wurmlab/GeneValidator

View on GitHub

Showing 74 of 132 total issues

File plots.js has 693 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
    GV - GeneValidator's JavaScript module

    Define a global GV (acronym for GeneValidator) object containing all
    GV associated methods:
Severity: Major
Found in aux/source_assets/js/plots.js - About 1 day to fix

    Function plot_lines has 121 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      GV.plot_lines = function (data, target, title, footer, xTitle, yTitle, no_lines, yValues) {
        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 4 hrs to fix

      Function plot_bars has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        GV.plot_bars = function (alldata, target, title, footer, xTitle, yTitle, bar) {
          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 4 hrs to fix

        Method hierarchical_clusterization has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def hierarchical_clusterization(no_clusters = 0, distance_method = 0,
                                            vec = @values, debug = false)
              clusters = []
              vec = vec.sort
        
        
        Severity: Minor
        Found in lib/genevalidator/clusterization.rb - About 4 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 plot_scatter has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          GV.plot_scatter = function (data, target, title, footer, xTitle, yTitle, yLine, slope) {
            var margin = {top: 50, right: 30, bottom: 75, left: 50},
            width = 500 - margin.left - margin.right,
            height = 500 - margin.top - margin.bottom;
        
        
        Severity: Major
        Found in aux/source_assets/js/plots.js - About 3 hrs to fix

          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

          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

          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

              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

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

                                def run(hits = @hits, prediction = @prediction)
                                  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_length_rank.rb - About 1 hr to fix

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

                                  def run(hits = @hits, prediction = @prediction)
                                    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_length_rank.rb - About 1 hr 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