Showing 164 of 238 total issues
Method course_module_completion_updated
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function course_module_completion_updated(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid); $lang = utils\get_course_lang($course);
- Create a ticketCreate a ticket
Method truefalse
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function truefalse(array $config, \stdClass $event, \stdClass $questionattempt, \stdClass $question) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid); $attempt = $repo->read_record('quiz_attempts', ['uniqueid' => $questionattempt->questionusageid]);
- Create a ticketCreate a ticket
Method notes_viewed
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function notes_viewed(array $config, \stdClass $event) { $repo = $config['repo']; //all three here may not exist $user=$repo->read_record_by_id('user', $event->userid);
- Create a ticketCreate a ticket
Method essay
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function essay(array $config, \stdClass $event, \stdClass $questionattempt, \stdClass $question) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid); $attempt = $repo->read_record('quiz_attempts', ['uniqueid' => $questionattempt->questionusageid]);
- Create a ticketCreate a ticket
Method numerical
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function numerical( array $config, \stdClass $event, \stdClass $feedbackvalue, \stdClass $feedbackitem,
- Create a ticketCreate a ticket
Method feedback_viewed
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function feedback_viewed(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->userid); $course = $repo->read_record_by_id('course', $event->courseid); $lang = utils\get_course_lang($course);
- Create a ticketCreate a ticket
Method multichoice
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function multichoice( array $config, \stdClass $event, \stdClass $feedbackvalue, \stdClass $feedbackitem,
- Create a ticketCreate a ticket
Method course_module
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function course_module(array $config, \stdClass $course, int $cmid) { $repo = $config['repo']; $coursemodule = $repo->read_record_by_id('course_modules', $cmid); $module = $repo->read_record_by_id('modules', $coursemodule->module); $instance = $repo->read_record_by_id($module->name, $coursemodule->instance);
- Create a ticketCreate a ticket
Method chapter_viewed
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function chapter_viewed(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->userid); $course = $repo->read_record_by_id('course', $event->courseid); $chapter = $repo->read_record_by_id('book_chapters', $event->objectid);
- Create a ticketCreate a ticket
Method certificate_revoked
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function certificate_revoked(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $revoker = $repo->read_record_by_id('user', $event->userid); $code = unserialize($event->other)['code'];
- Create a ticketCreate a ticket
Method certificate_issued
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function certificate_issued(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $issuer = $repo->read_record_by_id('user', $event->userid); $issue = $repo->read_record_by_id('tool_certificate_issues', $event->objectid);
- Create a ticketCreate a ticket
Function get_event_id
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function get_event_id($event) { global $DB; $sqlparams = array(); $where = array('1 = 1');
- Read upRead up
- Create a ticketCreate a ticket
Method shortanswer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function shortanswer(array $config, \stdClass $event, \stdClass $questionattempt, \stdClass $question) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid); $attempt = $repo->read_record('quiz_attempts', ['uniqueid' => $questionattempt->questionusageid]);
- Create a ticketCreate a ticket
Method badge_revoked
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function badge_revoked(array $config, \stdClass $event) { $repo = $config['repo']; $recipient = $repo->read_record_by_id('user', $event->relateduserid); $badge = $repo->read_record_by_id('badge', $event->objectid);
- Create a ticketCreate a ticket
Method certificate_verified
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function certificate_verified(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->userid); $issue = $repo->read_record_by_id('tool_certificate_issues', $event->objectid); $course = (!is_null($issue->courseid))
- Create a ticketCreate a ticket
Method submission_locked
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function submission_locked(array $config, \stdClass $event) { $repo = $config['repo']; $instructor = $repo->read_record_by_id('user', $event->userid); $learner = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid);
- Create a ticketCreate a ticket
Method comment_created
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function comment_created(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->userid); $course = $repo->read_record_by_id('course', $event->courseid); $comment = $repo->read_record_by_id('comments', $event->objectid);
- Create a ticketCreate a ticket
Method question_answered
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function question_answered(array $config, \stdClass $event) { $repo = $config['repo']; $user = $repo->read_record_by_id('user', $event->userid); $course = $repo->read_record_by_id('course', $event->courseid);
- Create a ticketCreate a ticket
Method handler
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handler(array $config, array $events) { $eventfunctionmap = get_event_function_map(); $transformedevents = array_map(function ($event) use ($config, $eventfunctionmap) { $eventobj = (object) $event;
- Create a ticketCreate a ticket
Method get_scorm_result
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_scorm_result(array $scormscoestracks, int $rawscore) { $maxscore = null; $minscore = null; foreach ($scormscoestracks as $st) {
- Create a ticketCreate a ticket