Showing 74 of 98 total issues
Avoid deeply nested control flow statements. Open
return x <= 1.0e+06 ? q_continued_fraction(a, x, with_error) : q_large_x(a, x, with_error)
Avoid deeply nested control flow statements. Open
if x > a - Math.sqrt(a)
return q_continued_fraction(a, x, with_error)
else
p = p_series(a, x, with_error)
p, p_err = p if with_error
Avoid deeply nested control flow statements. Open
scale_factor = scale ? Math.exp(x) : 1.0
Method q_asymptotic_uniform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def q_asymptotic_uniform(a, x, with_error = false)
rta = Math.sqrt(a)
eps = (x - a).quo(a)
ln_term = Log.log_1plusx_minusx(eps, with_error)
- 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 cdf
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cdf(aa, bb, sigma, epsilon = 0.0001, alpha = 2.5, max_iterations = 100) # :nodoc:
Method create_distribution_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_distribution_methods
Distribution.libraries_order.each do |l_name|
if const_defined? l_name
l = const_get(l_name)
# Add methods from engine to base base, if not yet included
- 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 q_series
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def q_series(a, x, with_error = false)
term1 = nil
sum = nil
term2 = nil
begin
- 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
Avoid deeply nested control flow statements. Open
result_c, result_c_err = result_c if with_error
Avoid deeply nested control flow statements. Open
elsif x <= 4.0
s = 1.0 / x * (scale ? 1.0 : Math.exp(-x))
result_c = ChebyshevSeries.eval((8.0 / x - 5.0) / 3.0, :ae13, with_error)
result_c, result_c_err = result_c if with_error
result = s * (1.0 + result_c)
Method q_chi2
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def q_chi2(df, chi2)
chi2 = chi2.to_f
if (df & 1) != 0
chi = Math.sqrt(chi2)
- 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 continued_fraction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def continued_fraction(a, b, x, epsabs = nil, with_error = false)
Method pdf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pdf(x, y, rho, s1 = 1.0, s2 = 1.0)
Method axpy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def axpy(aa, yy, a, b, x)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(coefficients, expansion_order, lower_interval_point, upper_interval_point, single_precision_order)
Method quantile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def quantile(p, a, b, rmin = 0, rmax = 1)
Method pdf_with_den
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pdf_with_den(k, m, n, total, den)
Method cdf_jantaravareerat
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cdf_jantaravareerat(x, y, rho, s1 = 1, s2 = 1)
Method pdf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pdf(x, y, rho, s1 = 1.0, s2 = 1.0)
Method f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(x, y, aprime, bprime, rho)
Method axpy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def axpy(aa, yy, a, b, x)
return aa * 0 + yy if x == 0.0
return aa * 1 + yy if x == 1.0
ln_beta = Math.logbeta(a, b)
- 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"