SciRuby/distribution

View on GitHub
lib/distribution/math_extension/chebyshev_series.rb

Summary

Maintainability
C
7 hrs
Test Coverage

File chebyshev_series.rb has 397 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Distribution
  module MathExtension
    # Adapted from GSL-1.9.
    class ChebyshevSeries
      DATA = { lopx: [2.16647910664395270521272590407,
Severity: Minor
Found in lib/distribution/math_extension/chebyshev_series.rb - About 5 hrs to fix

    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)
    Severity: Minor
    Found in lib/distribution/math_extension/chebyshev_series.rb - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                     gstar_b: [0.0057502277273114339831606096782,
                               0.0004496689534965685038254147807,
                               -0.0001672763153188717308905047405,
                               0.0000615137014913154794776670946,
                               -0.0000223726551711525016380862195,
      Severity: Minor
      Found in lib/distribution/math_extension/chebyshev_series.rb and 1 other location - About 25 mins to fix
      lib/distribution/math_extension/chebyshev_series.rb on lines 49..78

      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 31.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                     gstar_a: [2.16786447866463034423060819465,
                               -0.05533249018745584258035832802,
                               0.01800392431460719960888319748,
                               -0.00580919269468937714480019814,
                               0.00186523689488400339978881560,
      Severity: Minor
      Found in lib/distribution/math_extension/chebyshev_series.rb and 1 other location - About 25 mins to fix
      lib/distribution/math_extension/chebyshev_series.rb on lines 79..108

      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 31.

      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

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                     ae13: [-0.605773246640603460,
                            -0.112535243483660900,
                            0.013432266247902779,
                            -0.001926845187381145,
                            0.000309118337720603,
      Severity: Minor
      Found in lib/distribution/math_extension/chebyshev_series.rb and 2 other locations - About 15 mins to fix
      lib/distribution/math_extension/chebyshev_series.rb on lines 183..207
      lib/distribution/math_extension/chebyshev_series.rb on lines 279..303

      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 26.

      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

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                     erfc_x15: [0.44045832024338111077637466616,
                                -0.143958836762168335790826895326,
                                0.044786499817939267247056666937,
                                -0.013343124200271211203618353102,
                                0.003824682739750469767692372556,
      Severity: Minor
      Found in lib/distribution/math_extension/chebyshev_series.rb and 2 other locations - About 15 mins to fix
      lib/distribution/math_extension/chebyshev_series.rb on lines 183..207
      lib/distribution/math_extension/chebyshev_series.rb on lines 208..232

      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 26.

      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

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                     ae12: [0.582417495134726740,
                            -0.158348850905782750,
                            -0.006764275590323141,
                            0.005125843950185725,
                            0.000435232492169391,
      Severity: Minor
      Found in lib/distribution/math_extension/chebyshev_series.rb and 2 other locations - About 15 mins to fix
      lib/distribution/math_extension/chebyshev_series.rb on lines 208..232
      lib/distribution/math_extension/chebyshev_series.rb on lines 279..303

      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 26.

      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

      Further Reading

      There are no issues that match your filters.

      Category
      Status