Showing 1,205 of 1,252 total issues
Method not_late_submission_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def not_late_submission_hash(assessments, not_late_count)
assessments.each_with_object({}) do |assessment, counts|
num_late_student = not_late_count[assessment.id] ? @all_students.length - not_late_count[assessment.id] : 0
counts[assessment.id] = @reference_times_hash[assessment.id] ? num_late_student : 0
end
- Read upRead up
- Create a ticketCreate a ticket
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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
if @post.update(post_params)
respond_to do |format|
# Change post creator from system to updater if it is a codaveri feedback
# and send notification
- Read upRead up
- Create a ticketCreate a ticket
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 format_test_cases
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def format_test_cases
@public_test_cases = []
@private_test_cases = []
@evaluation_test_cases = []
- Read upRead up
- Create a ticketCreate a ticket
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_token_from_bearer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_token_from_bearer
authorization_header_elements = request.headers['Authorization']&.split
# render json: REQUIRES_AUTHENTICATION, status: :unauthorized and return unless authorization_header_elements
return nil unless authorization_header_elements
- Read upRead up
- Create a ticketCreate a ticket
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 zip_test_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def zip_test_files(test_type, zip) # rubocop:disable Metrics/AbcSize
tests = @test_params[:test_cases]
tests[test_type]&.each&.with_index(1) do |test, index|
# String types should be displayed with quotes, other types will be converted to string
# with the str method.
- Read upRead up
- Create a ticketCreate a ticket
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
Function AssessmentConditionForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AssessmentConditionForm = (
props: AnyConditionProps<AssessmentConditionData> & {
assessments: AvailableAssessments;
},
): JSX.Element => {
- Read upRead up
- Create a ticketCreate a ticket
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 generate_standard_submission_solution_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_standard_submission_solution_files(zip, submission_files_to_keep, solution_files_to_keep)
zip.mkdir('submission')
@test_params[:submission_files].try(:each) do |file|
next if file.nil?
- Read upRead up
- Create a ticketCreate a ticket
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
Function useDynamicNest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useDynamicNest = (): UseDynamicNestHook => {
const matches = useMatches();
const location = useLocation();
const [state, setState] = useState<CrumbState>({});
- Read upRead up
- Create a ticketCreate a ticket
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 sync_with_koditsu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sync_with_koditsu
is_course_koditsu_enabled = current_course.component_enabled?(Course::KoditsuPlatformComponent)
is_koditsu_enabled = is_course_koditsu_enabled && @assessment.is_koditsu_enabled
return head(:bad_request) unless is_koditsu_enabled
- Read upRead up
- Create a ticketCreate a ticket
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 switch_mcq_mrq_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def switch_mcq_mrq_type(is_mcq, unsubmit)
grading_scheme = is_mcq ? :any_correct : :all_correct
result = @multiple_response_question.update(grading_scheme: grading_scheme)
if result
- Read upRead up
- Create a ticketCreate a ticket
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 generate_nodes_from_conditionals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_nodes_from_conditionals(all_node_relations) # rubocop:disable Metrics/AbcSize
node_ids_to_children = all_node_relations[:node_ids_to_children]
node_ids_to_parents = all_node_relations[:node_ids_to_parents]
node_ids_to_unlock_level = all_node_relations[:node_ids_to_unlock_level]
students = current_course.course_users.students
- Read upRead up
- Create a ticketCreate a ticket
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 monitoring_configuration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def monitoring_configuration
if @assessment.monitor_id
monitoring = @assessment.monitor
monitoring_object = {
heartbeatIntervalMs: monitoring.max_interval_ms,
- Read upRead up
- Create a ticketCreate a ticket
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 zip_test_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def zip_test_files(test_type, zip) # rubocop:disable Metrics/AbcSize
tests = @test_params[:test_cases]
tests[test_type]&.each&.with_index(1) do |test, index|
# String types should be displayed with quotes, other types will be converted to string
# with the str method.
- Read upRead up
- Create a ticketCreate a ticket
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 view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view(data)
session_id, limit = data['session_id'], data['limit'] || DEFAULT_VIEW_HEARTBEATS_LIMIT
return unless (session = @monitor.sessions.find(session_id))
recent_heartbeats = (limit == -1 ? session.heartbeats : session.heartbeats.last(limit)).map do |heartbeat|
- Read upRead up
- Create a ticketCreate a ticket
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 fetch_all_submissions_from_koditsu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch_all_submissions_from_koditsu(assessment, user)
@assessment = assessment
@user = user
submission_service = Course::Assessment::Submission::KoditsuSubmissionService.new(@assessment)
status, response = submission_service.run_fetch_all_submissions
- Read upRead up
- Create a ticketCreate a ticket
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 extract_test_cases
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_test_cases
autograde_content = @package.test_files[Pathname.new('autograde.py')]
test_cases_with_id = preload_question_test_cases
assertion_types = assertion_types_regex
- Read upRead up
- Create a ticketCreate a ticket
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 closing_reminder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def closing_reminder(assessment, token)
email_enabled = assessment.course.email_enabled(:assessments, :closing_reminder, assessment.tab.category.id)
return unless assessment.closing_reminder_token == token && assessment.published?
return unless email_enabled.phantom || email_enabled.regular
- Read upRead up
- Create a ticketCreate a ticket
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
Function MuiTableToolbar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MuiTableToolbar = (props: ToolbarProps): JSX.Element | null => {
const { t } = useTranslation();
if (props.alternative?.when())
return <ToolbarContainer>{props.alternative.render()}</ToolbarContainer>;
- Read upRead up
- Create a ticketCreate a ticket
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
Function IconRadio
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const IconRadio = (props: IconRadioProps): JSX.Element => (
<label
className={`flex cursor-pointer py-2 ${
props.description ? 'items-start' : 'items-center'
}`}
- Read upRead up
- Create a ticketCreate a ticket
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
Function MuiTablePagination
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MuiTablePagination = (props: PaginationProps): JSX.Element => {
const { t } = useTranslation();
const rowsPerPageOptions = useMemo(() => {
const options: RowsPerPageOptions = props.pages?.slice() ?? [];
- Read upRead up
- Create a ticketCreate a ticket
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"