osaut/pindare

View on GitHub

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]

Severity: Minor
Found in lib/pindare/gradient.rb - About 1 hr 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 integrate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def integrate(tps, progress=false)

    t=0.0
    dt=0.0005

Severity: Minor
Found in example/model_simeoni.rb - About 1 hr 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 gradient has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def gradient(tol)
    params=params0.dup
    scal=1.0

    # Intégration initiale
Severity: Minor
Found in lib/pindare/gradient.rb - About 1 hr to fix

    Method diff_param has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def diff_param obsc, mod_class, params, pp, init_data, tmax, step
    Severity: Major
    Found in lib/pindare/gradient.rb - About 50 mins to fix

      Method update_params has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def update_params params, control_set, gradient, err, scal
      Severity: Minor
      Found in lib/pindare/gradient.rb - About 35 mins to fix

        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
        Severity: Minor
        Found in lib/pindare/gradient.rb - About 25 mins 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

        Severity
        Category
        Status
        Source
        Language