Class has too many lines. [121/100] Open
class Checkbox < UnscoredQuestion
include ActionView::Helpers
# This method returns what to display if an instructor (etc.) is creating or editing a questionnaire (questionnaires_controller.rb)
def edit(count)
html = edit_remove_button(count) + edit_seq(count) + edit_question(count)
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for complete is too high. [18.36/15] Open
def complete(count, answer = nil)
html = check_previous_question + complete_first_second_input(count, answer)
html += complete_third_input(count, answer)
html += '<label for="responses_' + count.to_s + '"> ' + txt + '</label>'
html += complete_script(count)
- 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
Assignment Branch Condition size for complete_first_second_input is too high. [17.58/15] Open
def complete_first_second_input(count, answer = nil)
html = '<input id="responses_' + count.to_s + '_comments" name="responses[' + count.to_s + '][comment]" type="hidden" value="">'
html += '<input id="responses_' + count.to_s + '_score" name="responses[' + count.to_s + '][score]" type="hidden"'
html += if !answer.nil? && (answer.answer == 1)
'value="1"'
- 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
Assignment Branch Condition size for view_question_text is too high. [16.64/15] Open
def view_question_text
html = '<TR><TD align="left"> ' + txt + ' </TD>'
html += '<TD align="left">' + type + '</TD>'
html += '<td align="center">' + weight.to_s + '</TD>'
html += '<TD align="center">Checked/Unchecked</TD>'
- 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
Assignment Branch Condition size for complete_script is too high. [15.81/15] Open
def complete_script(count)
html = '<script>function checkbox' + count.to_s + 'Changed() {'
html += ' var checkbox = jQuery("#responses_' + count.to_s + '_checkbox");'
html += ' var response_score = jQuery("#responses_' + count.to_s + '_score");'
html += 'if (checkbox.is(":checked")) {'
- 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
Missing top-level class documentation comment. Open
class Checkbox < UnscoredQuestion
- Read upRead up
- Exclude checks
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