GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 16-16 lines in 2 locations

view.php 1 location

@@ 34-49 (lines=16) @@
31
32
$context = context::instance_by_id($contextid);
33
$instanceid = $context->instanceid;
34
if ($context instanceof context_module) {
35
    $availability = $DB->get_field('course_modules', 'availability', array('id' => $instanceid), MUST_EXIST);
36
    $availability = json_decode($availability);
37
    foreach ($availability->c as $condition) {
38
        if ($condition->type == 'paypal') {
39
            // TODO: handle more than one paypal for this context.
40
            $paypal = $condition;
41
            break;
42
        } else {
43
            print_error('no paypal condition for this context.');
44
        }
45
    }
46
} else {
47
    // TODO: handle sections.
48
    print_error('support to sections not yet implemented.');
49
}
50
$coursecontext = $context->get_course_context();
51
$course = $DB->get_record('course', array('id' => $coursecontext->instanceid));
52

ipn.php 1 location

@@ 93-108 (lines=16) @@
90
}
91
92
$instanceid = $context->instanceid;
93
if ($context instanceof context_module) {
94
    $availability = $DB->get_field('course_modules', 'availability', array('id' => $instanceid), MUST_EXIST);
95
    $availability = json_decode($availability);
96
    foreach ($availability->c as $condition) {
97
        if ($condition->type == 'paypal') {
98
            // TODO: handle more than one paypal for this context.
99
            $paypal = $condition;
100
            break;
101
        } else {
102
            availability_paypal_message_error_to_admin("Not a valid context id", $data);
103
        }
104
    }
105
} else {
106
    // TODO: handle sections.
107
    print_error('support to sections not yet implemented.');
108
}
109
110
// Open a connection back to PayPal to validate the data.
111
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';