Showing 95 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|
- Read upRead up
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
- Read upRead up
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
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
- Read upRead up
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)}
- Read upRead up
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 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
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
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)
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
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.
#
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)}
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|
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
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
- Read upRead up
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 = {}
- Read upRead up
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
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
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
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
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