app/controllers/api/v2/calculations_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
95%

Method has too many lines. [14/10]
Open

      def evaluate
        calculator = Orbf::RulesEngine::CalculatorFactory.build(3)
        expression = params[:expression]
        calculations_params[:values].each do |key, value|
          expression = expression.gsub("%{#{key}}", value)

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Line is too long. [127/100]
Open

          result = { status: "error", expression: params[:expression], values: calculations_params[:values], error: e.message }

Final newline missing.
Open

end

This cop looks for trailing blank lines and a final newline in the source code.

Example: EnforcedStyle: finalblankline

# `final_blank_line` looks for one blank line followed by a new line
# at the end of files.

# bad
class Foo; end
# EOF

# bad
class Foo; end # EOF

# good
class Foo; end

# EOF

Example: EnforcedStyle: final_newline (default)

# `final_newline` looks for one newline at the end of files.

# bad
class Foo; end

# EOF

# bad
class Foo; end # EOF

# good
class Foo; end
# EOF

Line is too long. [143/100]
Open

          result = { status: "ok", expression: params[:expression], values: calculations_params[:values], result: solution["expression"].to_s }

There are no issues that match your filters.

Category
Status