ece517-p3/expertiza

View on GitHub
app/controllers/tree_display_controller.rb

Summary

Maintainability
C
1 day
Test Coverage

Class TreeDisplayController has 45 methods (exceeds 20 allowed). Consider refactoring.
Open

class TreeDisplayController < ApplicationController
  helper :application
  include SecurityHelper

  def action_allowed?
Severity: Minor
Found in app/controllers/tree_display_controller.rb - About 6 hrs to fix

    Assignment Branch Condition size for children_node_ng is too high. [23.62/15]
    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|

    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

    class TreeDisplayController < ApplicationController
      helper :application
      include SecurityHelper
    
      def action_allowed?
    Severity: Minor
    Found in app/controllers/tree_display_controller.rb - About 2 hrs to fix

      Rename is_user_instructor? to user_instructor?.
      Open

        def is_user_instructor?(instructor_id)

      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

        def is_user_ta?(instructor_id, child)

      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

      There are no issues that match your filters.

      Category
      Status