app/controllers/tree_display_controller.rb
Class TreeDisplayController
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class TreeDisplayController < ApplicationController
helper :application
include SecurityHelper
def action_allowed?
Assignment Branch Condition size for children_node_ng is too high. [23.62/15] Open
Open
def children_node_ng
flash[:error] = "Invalid JSON in the TreeList" unless json_valid? params[:reactParams][:child_nodes]
child_nodes = child_nodes_from_params(params[:reactParams][:child_nodes])
tmp_res = {}
child_nodes.each do |node|
- Read upRead up
- Exclude checks
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
File tree_display_controller.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class TreeDisplayController < ApplicationController
helper :application
include SecurityHelper
def action_allowed?
Rename is_user_instructor?
to user_instructor?
. Open
Open
def is_user_instructor?(instructor_id)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Rename is_user_ta?
to user_ta?
. Open
Open
def is_user_ta?(instructor_id, child)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end