xAPI-vle/moodle-logstore_xapi

View on GitHub
classes/log/store.php

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 4 of 4 total issues

Method get_event_id has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function get_event_id($event) {
global $DB;
 
$sqlparams = array();
$where = array('1 = 1');
Severity: Major
Found in classes/log/store.php - About 2 hrs to fix

Method get_handler_config has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function get_handler_config() {
global $DB, $CFG;
 
$plugin = core_plugin_manager::instance()->get_plugin_info('logstore_xapi');
 
 
Severity: Major
Found in classes/log/store.php - About 2 hrs to fix

Function get_event_id has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

protected function get_event_id($event) {
global $DB;
 
$sqlparams = array();
$where = array('1 = 1');
Severity: Minor
Found in classes/log/store.php - About 1 hr to fix

Function convert_array_to_objects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

protected function convert_array_to_objects($events) {
$return = array();
 
if (!empty($events)) {
foreach ($events as $event) {
Severity: Minor
Found in classes/log/store.php - About 35 mins to fix

There are no issues that match your filters.

Category
Status