Skip to content

code_review

code_review #8

Triggered via push December 26, 2024 08:43
Status Success
Total duration 20m 5s
Artifacts

infection.yml

on: push
Matrix: infection
Fit to window
Zoom out
Zoom in

Annotations

11 warnings
infection (main, 8.3, pgsql)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L114
Escaped Mutant for Mutator "GreaterThan": @@ @@ // Always not available if for some reason the value could not be calculated. return false; } - $allow = time() > $calc; + $allow = time() >= $calc; if ($not) { $allow = !$allow; }
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L168
Escaped Mutant for Mutator "Assignment": @@ @@ if (get_coursemodule_from_id('', $this->relativecoursemodule)) { $modname .= \core_availability\condition::description_cm_name($this->relativecoursemodule); } else { - $modname .= \html_writer::span(get_string('missing', 'availability_relativedate'), 'alert alert-danger'); + $modname = \html_writer::span(get_string('missing', 'availability_relativedate'), 'alert alert-danger'); } } return ' ' . $this->relativenumber . ' ' . self::options_dwm($this->relativenumber)[$this->relativedwm] . ' ' . self::options_start($this->relativestart) . $modname;
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L279
Escaped Mutant for Mutator "LessThan": @@ @@ return $this->fixdate("+{$x}", $lowest); case 7: // Since completion of a module. - if ($this->relativecoursemodule < 1) { + if ($this->relativecoursemodule <= 1) { return 0; } $cm = new stdClass();
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L288
Escaped Mutant for Mutator "FalseValue": @@ @@ $cm->course = $course->id; try { $completion = new \completion_info($course); - $data = $completion->get_data($cm, false, $userid); + $data = $completion->get_data($cm, true, $userid); return $this->fixdate("+{$x}", $data->timemodified); } catch (\Exception $e) { return 0;
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L362
Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ } // Availability of sections (get_section_info_all) is always null. $sqllike = $DB->sql_like('availability', ':availability'); - $params = ['course' => $courseobj->id, 'availability' => '%"s":7,"m":' . $cmid . '%']; + $params = ['course' => $courseobj->id, 'availability' => '%"s":7,"m":' . '%']; return count($DB->get_records_sql("SELECT id FROM {course_sections} WHERE course = :course AND {$sqllike}", $params)) > 0; } /**
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L399
Escaped Mutant for Mutator "LogicalNot": @@ @@ $rec = \restore_dbops::get_backup_ids_record($restoreid, 'course_module', $this->relativecoursemodule); if (!($rec && $rec->newitemid)) { // If we are on the same course (e.g. duplicate) then we can just use the existing one. - if (!get_coursemodule_from_id('', $this->relativecoursemodule, $courseid)) { + if (get_coursemodule_from_id('', $this->relativecoursemodule, $courseid)) { $this->relativecoursemodule = 0; $logger->process("Restored item ({$name} has availability condition on module that was not restored", \backup::LOG_WARNING); return false;
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L400
Escaped Mutant for Mutator "DecrementInteger": @@ @@ if (!($rec && $rec->newitemid)) { // If we are on the same course (e.g. duplicate) then we can just use the existing one. if (!get_coursemodule_from_id('', $this->relativecoursemodule, $courseid)) { - $this->relativecoursemodule = 0; + $this->relativecoursemodule = -1; $logger->process("Restored item ({$name} has availability condition on module that was not restored", \backup::LOG_WARNING); return false; }
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L401
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ // If we are on the same course (e.g. duplicate) then we can just use the existing one. if (!get_coursemodule_from_id('', $this->relativecoursemodule, $courseid)) { $this->relativecoursemodule = 0; - $logger->process("Restored item ({$name} has availability condition on module that was not restored", \backup::LOG_WARNING); + return false; } } else {
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L405
Escaped Mutant for Mutator "FalseValue": @@ @@ if (!get_coursemodule_from_id('', $this->relativecoursemodule, $courseid)) { $this->relativecoursemodule = 0; $logger->process("Restored item ({$name} has availability condition on module that was not restored", \backup::LOG_WARNING); - return false; + return true; } } else { $this->relativecoursemodule = $rec->newitemid;
infection (main, 8.3, pgsql): moodle/availability/condition/relativedate/classes/condition.php#L410
Escaped Mutant for Mutator "TrueValue": @@ @@ } else { $this->relativecoursemodule = $rec->newitemid; } - return true; + return false; } }