Showing 6 of 6 total issues
Method update_params
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def update_params params, control_set, gradient, err, scal
pas=Math::sqrt(err)*0.01/(1.0+Math::sqrt(err))
control_set.each do |p|
new_value=params[p]-scal*pas*gradient[p]
- 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 integrate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def integrate(tps, progress=false)
t=0.0
dt=0.0005
- 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 gradient
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gradient(tol)
params=params0.dup
scal=1.0
# Intégration initiale
Method diff_param
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def diff_param obsc, mod_class, params, pp, init_data, tmax, step
Method update_params
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_params params, control_set, gradient, err, scal
Method gradient
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gradient(tol)
params=params0.dup
scal=1.0
# Intégration initiale
- 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"