Assignment Branch Condition size for update is too high. [32.26/15] Open
def update
@team = AssignmentTeam.find_by(id: params[:id])
@team.update_attributes(comments_for_advertisement: params[:comments_for_advertisement])
participant = AssignmentParticipant.find_by(parent_id: @team.assignment.id, user_id: session[:user].id)
rescue StandardError
- 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 remove is too high. [31.27/15] Open
def remove
team = AssignmentTeam.find_by(id: params[:team_id])
team.update_attributes(advertise_for_partner: false, comments_for_advertisement: nil)
participant = AssignmentParticipant.find_by(parent_id: team.assignment.id, user_id: session[:user].id)
rescue StandardError
- 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 create is too high. [22.09/15] Open
def create
team = AssignmentTeam.find_by(id: params[:id])
team.update_attributes(advertise_for_partner: true, comments_for_advertisement: params[:comments_for_advertisement])
participant = AssignmentParticipant.find_by(parent_id: team.assignment.id, user_id: session[:user].id)
ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, 'Your advertisement has been successfully created.', request)
- 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 action_allowed? is too high. [17.58/15] Open
def action_allowed?
# Any user with at least a Student role should be able to advertise for a partner
# For the create, edit, update, and remove actions the current user should also be a participant in the assignment
# 'create' and 'update' are separated from 'edit' and 'remove' because they use different params
case params[:action]
- 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
Method has too many lines. [12/10] Open
def action_allowed?
# Any user with at least a Student role should be able to advertise for a partner
# For the create, edit, update, and remove actions the current user should also be a participant in the assignment
# 'create' and 'update' are separated from 'edit' and 'remove' because they use different params
case params[:action]
- Read upRead up
- Exclude checks
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.
Method has too many lines. [11/10] Open
def remove
team = AssignmentTeam.find_by(id: params[:team_id])
team.update_attributes(advertise_for_partner: false, comments_for_advertisement: nil)
participant = AssignmentParticipant.find_by(parent_id: team.assignment.id, user_id: session[:user].id)
rescue StandardError
- Read upRead up
- Exclude checks
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.
Method has too many lines. [11/10] Open
def update
@team = AssignmentTeam.find_by(id: params[:id])
@team.update_attributes(comments_for_advertisement: params[:comments_for_advertisement])
participant = AssignmentParticipant.find_by(parent_id: @team.assignment.id, user_id: session[:user].id)
rescue StandardError
- Read upRead up
- Exclude checks
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.
Missing top-level class documentation comment. Open
class AdvertiseForPartnerController < ApplicationController
- 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