Showing 98 of 98 total issues
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 pdf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pdf(x, y, rho, s1 = 1.0, s2 = 1.0)
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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def axpy(aa, yy, a, b, x)
Method pdf_with_den
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pdf_with_den(k, m, n, total, den)
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"
Further reading
Identical blocks of code found in 2 locations. Consider refactoring. Open
result = x * (1.0 + x * (C1 + x * (C2 + x * (C3 + x * (C4 + x * begin
C5 + x * (C6 + x * (C7 + x * (C8 + x * C9))) # formerly t = this
- Read upRead up
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 34.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
result = x * x * (C1 + x * (C2 + x * (C3 + x * (C4 + x * begin
C5 + x * (C6 + x * (C7 + x * (C8 + x * C9))) # formerly t = this
- Read upRead up
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 34.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
p = p_series(a, x, with_error)
p, p_err = p if with_error
result = 1.0 - p
return with_error ? [result, p_err + 2.0 * Float::EPSILON * result.abs] : result
elsif a >= 1.0e+06 && (x - a) * (x - a) < a # difficult asymptotic regime, only way to do this region
- Read upRead up
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 33.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
p = p_series(a, x, with_error)
p, p_err = p if with_error
result = 1.0 - p
return with_error ? [result, p_err + 2.0 * Float::EPSILON * result.abs] : result
end
- Read upRead up
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 33.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid too many return
statements within this method. Open
return q_large_x_complement(a, x, with_error)
Avoid too many return
statements within this method. Open
return series(a.to_f, x.to_f, with_error)
Avoid too many return
statements within this method. Open
return with_error ? [result, 2.0 * (1.0 + a.abs) * Float::EPSILON * gax.abs] : result
Avoid too many return
statements within this method. Open
return x <= 1.0e+06 ? q_continued_fraction(a, x, with_error) : q_large_x(a, x, with_error)
Avoid too many return
statements within this method. Open
return with_error ? [result, p_err + 2.0 * Float::EPSILON * result.abs] : result
Avoid too many return
statements within this method. Open
return p_series(a, x, with_error)
Avoid too many return
statements within this method. Open
return value.nan? ? Float::NAN : value
Avoid too many return
statements within this method. Open
return cdf(a, 0.0, rho1) + cdf(b, 0.0, rho2) - delta
Avoid too many return
statements within this method. Open
return q_asymptotic_uniform_complement a, x, with_error