SciRuby/statsample

View on GitHub

Showing 133 of 133 total issues

Method report_building has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

      def report_building(builder) #:nodoc:
        builder.section(:name=>@name) do |s|
          
          if @dumped.size>0
            s.section(:name=>"Items with variance=0") do |s1|
Severity: Minor
Found in lib/statsample/reliability/scaleanalysis.rb - 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

Method rubyvis_panel has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

      def rubyvis_panel # :nodoc:
        that=self
        #p @v1.map {|v| v}
        
        @minimum_x||=@v1.min
Severity: Minor
Found in lib/statsample/graph/scatterplot.rb - 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

Method rubyvis_panel has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def rubyvis_panel # :nodoc:
        that=self
        
        min,max=@minimum, @maximum
        
Severity: Major
Found in lib/statsample/graph/boxplot.rb - About 4 hrs to fix

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

          def rubyvis_panel # :nodoc:
            that=self
            
            min,max=@minimum, @maximum
            
    Severity: Minor
    Found in lib/statsample/graph/boxplot.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

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

        def iterate
          k_matrix=@use_gsl ? GSL::Matrix : ::Matrix
          t=k_matrix.identity(@m)
          b=(@use_gsl ? @matrix.to_gsl : @matrix.dup)
          h=k_matrix.diagonal(*@h2).collect {|c| Math::sqrt(c)}
    Severity: Minor
    Found in lib/statsample/factor/rotation.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

    Class BaseEngine has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class BaseEngine
            include Statsample::Summarizable
            # Name of analysis
            attr_accessor :name
            # Minimum number of  valid case for pairs of correlation
    Severity: Minor
    Found in lib/statsample/regression/multiple/baseengine.rb - About 3 hrs to fix

      Class StratifiedSample has 31 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class StratifiedSample
          class << self
            # mean for an array of vectors
            def mean(*vectors)
              n_total=0
      Severity: Minor
      Found in lib/statsample/multiset.rb - About 3 hrs to fix

        File bivariate.rb has 316 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'statsample/bivariate/pearson'
        module Statsample
          # Diverse methods and classes to calculate bivariate relations
          # Specific classes: 
          # * Statsample::Bivariate::Pearson : Pearson correlation coefficient (r)
        Severity: Minor
        Found in lib/statsample/bivariate.rb - About 3 hrs to fix

          Class ICC has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class ICC
                include Summarizable
                
                # Create a ICC analysis for a given dataset
                # Each vector is a different measurement. Only uses complete data 
          Severity: Minor
          Found in lib/statsample/reliability/icc.rb - About 3 hrs to fix

            File dominanceanalysis.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Statsample
              # Dominance Analysis is a procedure based on an examination of the R<sup>2</sup> values
              # for all possible subset models, to identify the relevance of one or more 
              # predictors in the prediction of criterium.
              #
            Severity: Minor
            Found in lib/statsample/dominanceanalysis.rb - About 3 hrs to fix

              Method iterate has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def iterate
                    k_matrix=@use_gsl ? GSL::Matrix : ::Matrix
                    t=k_matrix.identity(@m)
                    b=(@use_gsl ? @matrix.to_gsl : @matrix.dup)
                    h=k_matrix.diagonal(*@h2).collect {|c| Math::sqrt(c)}
              Severity: Major
              Found in lib/statsample/factor/rotation.rb - About 2 hrs to fix

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

                      def report_building(builder) #:nodoc:
                        builder.section(:name=>@name) do |s|
                          
                          if @dumped.size>0
                            s.section(:name=>"Items with variance=0") do |s1|
                Severity: Major
                Found in lib/statsample/reliability/scaleanalysis.rb - About 2 hrs to fix

                  File icc.rb has 282 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module Statsample
                    module Reliability
                      # = Intra-class correlation
                      # According to Shrout & Fleiss (1979, p.422): "ICC is the correlation 
                      # between one measurement (either a single rating or a mean of 
                  Severity: Minor
                  Found in lib/statsample/reliability/icc.rb - About 2 hrs to fix

                    Method compute has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def compute
                            @original=Statsample::Bivariate.send(matrix_method, @ds).eigenvalues unless no_data
                            @ds_eigenvalues=Daru::DataFrame.new({}, order: (1..@n_variables).map{|v| ("ev_%05d" % v).to_sym})
                            
                            if bootstrap_method==:parameter or bootstrap_method==:random
                    Severity: Minor
                    Found in lib/statsample/factor/parallelanalysis.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 corrected_dataset has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def corrected_dataset
                            if @cds.nil?
                              @cds = Daru::DataFrame.new({}, order: @ds.vectors, name: @ds.name)
                              @ds.each_row do |row|
                                out = {}
                    Severity: Minor
                    Found in lib/statsample/reliability/skillscaleanalysis.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 type= has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def type=(v)
                            case v
                              when :icc_1_1
                                @icc_name=_("Shrout & Fleiss ICC(1,1)")
                                @r=@icc_1_1
                    Severity: Major
                    Found in lib/statsample/reliability/icc.rb - About 2 hrs to fix

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

                            def rubyvis_panel # :nodoc:
                              that=self
                              #p @v1.map {|v| v}
                              
                              @minimum_x||=@v1.min
                      Severity: Major
                      Found in lib/statsample/graph/scatterplot.rb - About 2 hrs to fix

                        Method rubyvis_panel has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def rubyvis_panel # :nodoc:
                                pre_vis
                                #that=self
                                
                                @minimum_x||=@hist.min
                        Severity: Major
                        Found in lib/statsample/graph/histogram.rb - About 2 hrs to fix

                          Class DominanceAnalysis has 21 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class DominanceAnalysis
                              include Summarizable
                              # Class to generate the regressions. Default to Statsample::Regression::Multiple::MatrixEngine
                              attr_accessor :regression_class
                              # Name of analysis
                          Severity: Minor
                          Found in lib/statsample/dominanceanalysis.rb - About 2 hrs to fix

                            Method initialize has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def initialize(opts=Hash.new)
                                    raise "You should insert at least :a, :b and :dependent" unless  [:a, :b, :dependent].all? {|v| opts.has_key? v}
                                    @a_var   = :a
                                    @b_var   = :b
                                    @dep_var = :dependent
                            Severity: Major
                            Found in lib/statsample/anova/twoway.rb - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language