xAPI-vle/moodle-logstore_xapi

View on GitHub
src/transformer/events/mod_forum/discussion_viewed.php

Summary

Maintainability
C
1 day
Test Coverage

Showing 2 of 2 total issues

Method discussion_viewed has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function discussion_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);
$discussion = $repo->read_record_by_id('forum_discussions', $event->objectid);
Severity: Minor
Found in src/transformer/events/mod_forum/discussion_viewed.php - About 1 hr to fix

Similar blocks of code found in 4 locations. Consider refactoring.
Open

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Severity: Major
Found in src/transformer/events/mod_forum/discussion_viewed.php and 3 other locations - About 7 hrs to fix
src/transformer/events/mod_forum/discussion_created.php on lines 1..69
src/transformer/events/mod_questionnaire/all_responses_viewed.php on lines 1..71
src/transformer/events/mod_wiki/page_viewed.php on lines 1..72

There are no issues that match your filters.

Category
Status