Showing 2,813 of 2,813 total issues
Assignment Branch Condition size for notify_grade_conflict_message is too high. [18.97/15] Open
def notify_grade_conflict_message(defn)
@body = defn[:body]
@assignment = @body[:assignment]
@reviewer_name = @body[:reviewer_name]
- 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
Consider simplifying this complex logical expression. Open
if (((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
(entry.creation_date && entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
(entry.institution && entry.institution.indexOf(_this.props.filterText) !== -1) ||
(entry.updated_date && entry.updated_date.indexOf(_this.props.filterText) !== -1)) &&
(entry.private == true || entry.type == 'FolderNode')) {
Method list
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list
@automated_metareview = AutomatedMetareview.new
# pass in the response id as a parameter
@response = Response.find_by(map_id: params[:id])
@automated_metareview.calculate_metareview_metrics(@response, params[:id])
Block has too many lines. [45/25] Open
describe SignUpSheet do
describe '.add_signup_topic' do
it 'will return an empty Hash when there are no topics' do
assignment = double('Assignment')
allow(assignment).to receive(:num_review_rounds) { nil }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [45/25] Open
describe LotteryController do
describe "#run_intelligent_assignmnent" do
it "webservice call should be successful" do
dat = double("data")
rest = double("RestClient")
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [45/25] Open
describe "Integration tests for instructor interface" do
before(:each) do
assignment_setup
end
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Function col_sort
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function col_sort(m) {
lesser = !lesser
// Swaps two columns of the table
jQuery.moveColumn = function (table, from, to) {
var rows = jQuery('tr', table);
Method scores
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scores(questions)
scores = {}
scores[:participants] = {}
self.participants.each do |participant|
scores[:participants][participant.id.to_s.to_sym] = participant.scores(questions)
Method save_topic_deadlines
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_topic_deadlines
assignment = Assignment.find(params[:assignment_id])
@assignment_submission_due_dates = assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1 }
@assignment_review_due_dates = assignment.due_dates.select {|due_date| due_date.deadline_type_id == 2 }
due_dates = params[:due_date]
Method update_quiz
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_quiz
@questionnaire = Questionnaire.find(params[:id])
if @questionnaire.nil?
redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]
return
Function getShowHour
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function getShowHour()
{
var finalHour;
if (TimeMode==12)
{
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method get_all_versions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_all_versions
if self.review_mapping.response
@sorted_array = []
@prev = Response.all
@prev.each do |element|
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method teamed_students
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.teamed_students(user, ip_address = nil)
students_teamed = {}
user.teams.each do |team|
next unless team.is_a?(AssignmentTeam)
# Teammates in calibration assignment should not be counted in teaming requirement.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method html_control
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def html_control(tag_prompt_deployment, answer, user_id)
html = ""
unless answer.nil?
stored_tags = AnswerTag.where(tag_prompt_deployment_id: tag_prompt_deployment.id, answer_id: answer.id, user_id: user_id)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method render_participant_info
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def render_participant_info(topic, assignment, participants)
html = ''
if participants.present?
chooser_present = false
participants.each do |participant|
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method perform
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def perform(assignment_id, deadline_type, due_at)
self.assignment_id = assignment_id
self.deadline_type = deadline_type
self.due_at = due_at
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Block has too many lines. [44/25] Open
describe '#scores' do
before(:each) do
allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: 1)
.and_return(double('AssignmentQuestionnaire', used_in_round: 1))
allow(review_questionnaire).to receive(:symbol).and_return(:review)
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [44/25] Open
describe "Testing copy functionality - " do
it "test for inherit" do
assignment = build(Assignment)
course = Course.new
course.name = "newCourse"
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [44/25] Open
describe DeadlineHelper do
before(:each) do
@deadline_type = create(:deadline_type)
@deadline_right = create(:deadline_right)
@topic_due_date = create(:topic_due_date, deadline_type: @deadline_type,
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [44/25] Open
it "test2: in round 2, both students should be in review stage to review each other" do
# impersonate each participant submit their topics
submit_topic('student2064', '/sign_up_sheet/sign_up?id=1&topic_id=1', "https://google.com")
submit_topic('student2065', '/sign_up_sheet/sign_up?id=1&topic_id=2', "https://ncsu.edu")
# change deadline to make both in review stage in round 2
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.