xAPI-vle/moodle-logstore_xapi

View on GitHub
amd/src/replayevents.js

Summary

Maintainability
D
1 day
Test Coverage

Showing 8 of 8 total issues

File replayevents.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// 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
// the Free Software Foundation, either version 3 of the License, or
Severity: Minor
Found in amd/src/replayevents.js - About 3 hrs to fix

Function registerResendEvent has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

registerResendEvent: function() {
var self = this;
 
if (selectorChanged) {
return;
Severity: Minor
Found in amd/src/replayevents.js - About 1 hr to fix

Function doReplayEvent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

doReplayEvent: function(eventId) {
var url = mdlcfg.wwwroot + '/admin/tool/log/store/xapi/ajax/moveback_to_log.php';
var eventIds = [eventId];
var self = this;
var element = $('#' + REPLAY_EVENT_ID_PREFIX + eventId);
Severity: Minor
Found in amd/src/replayevents.js - About 1 hr to fix

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

generateLoadHTML: function() {
str.get_strings([
{
key: 'loadinghelp',
component: 'moodle'
Severity: Major
Found in amd/src/replayevents.js and 2 other locations - About 2 hrs to fix
amd/src/replayevents.js on lines 483..495
amd/src/replayevents.js on lines 500..512

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

generateFailedHTML: function() {
str.get_strings([
{
key: 'failed',
component: 'logstore_xapi'
Severity: Major
Found in amd/src/replayevents.js and 2 other locations - About 2 hrs to fix
amd/src/replayevents.js on lines 466..478
amd/src/replayevents.js on lines 483..495

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

generateDoneHTML: function() {
str.get_strings([
{
key: 'success',
component: 'moodle'
Severity: Major
Found in amd/src/replayevents.js and 2 other locations - About 2 hrs to fix
amd/src/replayevents.js on lines 466..478
amd/src/replayevents.js on lines 500..512

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

enableFormControls: function() {
this.enableFormCheckboxes();
this.enableFormSelects();
this.enableFormSubmit();
this.enableResend();
Severity: Minor
Found in amd/src/replayevents.js and 1 other location - About 50 mins to fix
amd/src/replayevents.js on lines 446..451

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

disableFormControls: function() {
this.disableFormSubmit();
this.disableFormCheckboxes();
this.disableFormSelects();
this.disableResend();
Severity: Minor
Found in amd/src/replayevents.js and 1 other location - About 50 mins to fix
amd/src/replayevents.js on lines 456..461
Category
Status