wearefine/fae

View on GitHub
app/controllers/fae/form_managers_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for update is too high. [21.31/15]
Open

    def update
      if params[:form_manager].present?
        fields_serialized = params[:form_manager][:fields].to_json
        conditions = {
          form_manager_model_name: params[:form_manager][:form_manager_model_name],

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

    def update
      if params[:form_manager].present?
        fields_serialized = params[:form_manager][:fields].to_json
        conditions = {
          form_manager_model_name: params[:form_manager][:form_manager_model_name],

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. [92/80]
Open

          conditions[:form_manager_model_id] = params[:form_manager][:form_manager_model_id]

Missing top-level class documentation comment.
Open

  class FormManagersController < ApplicationController

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Line is too long. [83/80]
Open

          form_manager_model_name: params[:form_manager][:form_manager_model_name],

Avoid comma after the last item of a hash.
Open

          form_manager_model_name: params[:form_manager][:form_manager_model_name],

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Extra empty line detected at class body end.
Open


  end

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Extra empty line detected at class body beginning.
Open


    def update

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Line is too long. [102/80]
Open

        FormManager.where(conditions).first_or_initialize.update_attribute(:fields, fields_serialized)

There are no issues that match your filters.

Category
Status