SciRuby/statsample

View on GitHub
lib/statsample/regression/multiple/baseengine.rb

Summary

Maintainability
B
6 hrs
Test Coverage

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
Severity: Minor
Found in lib/statsample/regression/multiple/baseengine.rb - About 3 hrs to fix

    Method report_building has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def report_building(b)
              di="%0.#{digits}f"
              b.section(:name=>@name) do |g|
                c=coeffs
                g.text _("Engine: %s") % self.class
    Severity: Minor
    Found in lib/statsample/regression/multiple/baseengine.rb - About 45 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

    Method residuals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def residuals
              Daru::Vector.new(
                (0...@total_cases).collect do |i|
                  invalid=false
                  vect=@dep_columns.collect{|v| invalid=true if v[i].nil?; v[i]}
    Severity: Minor
    Found in lib/statsample/regression/multiple/baseengine.rb - About 35 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

    Method predicted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def predicted
              Daru::Vector.new(
                @total_cases.times.collect do |i|
                  invalid = false
                  vect = @dep_columns.collect {|v| invalid = true if v[i].nil?; v[i]}
    Severity: Minor
    Found in lib/statsample/regression/multiple/baseengine.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

    Method ssr_direct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def ssr_direct
              mean=@dy.mean
              cases=0
              ssr=(0...@ds.cases).inject(0) {|a,i|
                invalid=false
    Severity: Minor
    Found in lib/statsample/regression/multiple/baseengine.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

    There are no issues that match your filters.

    Category
    Status