xAPI-vle/moodle-logstore_xapi

View on GitHub

Showing 238 of 238 total issues

Avoid too many return statements within this method.
Open

return [];
Severity: Major
Found in src/transformer/events/mod_feedback/item_answered/handler.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return [];
Severity: Major
Found in src/transformer/events/mod_quiz/question_answered/handler.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return multichoice($config, $event, $questionattempt, $question);
Severity: Major
Found in src/transformer/events/mod_quiz/question_answered/handler.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return $activity;
Severity: Major
Found in src/transformer/utils/get_activity/lesson_question_page.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return textfield($config, $event, $feedbackvalue, $feedbackitem, $actor);
Severity: Major
Found in src/transformer/events/mod_feedback/item_answered/handler.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return shortanswer($config, $event, $questionattempt, $question);
Severity: Major
Found in src/transformer/events/mod_quiz/question_answered/handler.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return get_numerical_definition($config, $question, $lang);
Severity: Major
Found in src/transformer/utils/get_activity/definition/question.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return [];
Severity: Major
Found in src/transformer/utils/get_activity/definition/question.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return get_shortanswer_definition($config, $question, $lang);
Severity: Major
Found in src/transformer/utils/get_activity/definition/question.php - About 30 mins to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'context' => [
...utils\get_context_base($config, $event, $lang, $course),
'contextActivities' => [
'parent' => [
utils\get_activity\wiki_page(
Severity: Minor
Found in src/transformer/events/mod_wiki/comment_created.php and 1 other location - About 30 mins to fix
src/transformer/events/mod_wiki/comments_viewed.php on lines 56..75

Avoid too many return statements within this method.
Open

return ''; // Return blank if no errortype captured.
Severity: Major
Found in lib.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return get_string('unknownerror', 'logstore_xapi', $row->errortype);
Severity: Major
Found in lib.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return get_string('failedtransformresponse', 'logstore_xapi', $row->eventname);
Severity: Major
Found in lib.php - About 30 mins to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'context' => [
...utils\get_context_base($config, $event, $lang, $course),
'contextActivities' => [
'parent' => [
utils\get_activity\wiki_page(
Severity: Minor
Found in src/transformer/events/mod_wiki/comments_viewed.php and 1 other location - About 30 mins to fix
src/transformer/events/mod_wiki/comment_created.php on lines 60..79

Function take_attendance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function take_attendance(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);
Severity: Minor
Found in src/transformer/events/mod_facetoface/take_attendance.php - About 25 mins to fix

Function deep_merge_arrays has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function deep_merge_arrays($arr1, $arr2) {
// Merge the second array into the first one
foreach ($arr2 as $key => $value) {
// If the key exists in the first array and both values are arrays, recurse
if (array_key_exists($key, $arr1) && is_array($arr1[$key]) && is_array($value)) {
Severity: Minor
Found in src/transformer/utils/deep_merge_arrays.php - About 25 mins to fix

Function move_event has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

protected function move_event($event) {
global $DB;
 
$skipinsert = false;
 
 
Severity: Minor
Found in classes/log/moveback.php - About 25 mins to fix

Function insert_row has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function insert_row($table, $rowcsv) {
global $DB;
$obj = get_object();
$strarr = explode(",", $rowcsv);
$type = logstore_xapi_get_type_from_table($table);
Severity: Minor
Found in cli/testdataseeder.php - About 25 mins to fix
Severity
Category
Status
Source
Language