expertiza/expertiza

View on GitHub
app/models/questionnaire_type_node.rb

Summary

Maintainability
A
1 hr
Test Coverage
F
42%

Method get_children has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)
Severity: Minor
Found in app/models/questionnaire_type_node.rb - About 45 mins to fix

    Method get has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.get(_sortvar = nil, _sortorder = nil, _user_id = nil, _show = nil, _parent_id = nil, _search = nil)
    Severity: Minor
    Found in app/models/questionnaire_type_node.rb - About 45 mins to fix

      Avoid parameter lists longer than 5 parameters. [6/5]
      Open

        def self.get(_sortvar = nil, _sortorder = nil, _user_id = nil, _show = nil, _parent_id = nil, _search = nil)

      This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

      Avoid parameter lists longer than 5 parameters. [6/5]
      Open

        def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)

      This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

      Do not prefix reader method names with get_.
      Open

        def get_name

      This cop makes sure that accessor methods are named properly.

      Example:

      # bad
      def set_attribute(value)
      end
      
      # good
      def attribute=(value)
      end
      
      # bad
      def get_attribute
      end
      
      # good
      def attribute
      end

      Do not prefix reader method names with get_.
      Open

        def get_partial_name

      This cop makes sure that accessor methods are named properly.

      Example:

      # bad
      def set_attribute(value)
      end
      
      # good
      def attribute=(value)
      end
      
      # bad
      def get_attribute
      end
      
      # good
      def attribute
      end

      Missing top-level class documentation comment.
      Open

      class QuestionnaireTypeNode < FolderNode

      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

      There are no issues that match your filters.

      Category
      Status