expertiza/expertiza

View on GitHub
app/models/quiz_response_map.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

  def quiz_score
    questionnaire_id = reviewed_object_id # the reviewed id is questionnaire id in response map table
    response_id = begin
                    response.first.id
                  rescue StandardError
Severity: Minor
Found in app/models/quiz_response_map.rb by rubocop

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.

Assignment Branch Condition size for quiz_score is too high. [17.23/15]
Open

  def quiz_score
    questionnaire_id = reviewed_object_id # the reviewed id is questionnaire id in response map table
    response_id = begin
                    response.first.id
                  rescue StandardError
Severity: Minor
Found in app/models/quiz_response_map.rb by rubocop

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

Do not prefix reader method names with get_.
Open

  def get_title
Severity: Minor
Found in app/models/quiz_response_map.rb by rubocop

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 QuizResponseMap < ResponseMap
Severity: Minor
Found in app/models/quiz_response_map.rb by rubocop

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