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.

javascript/ReCaptchaField.js   A
last analyzed

Complexity

Total Complexity 9
Complexity/F 1.29

Size

Lines of Code 44
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 27
c 0
b 0
f 0
dl 0
loc 44
rs 10
wmc 9
mnd 2
bc 2
fnc 7
bpm 0.2857
cpm 1.2857
noi 0

6 Functions

Rating   Name   Duplication   Size   Complexity  
A ReCaptchaField.js ➔ init 0 7 2
A ReCaptchaField.js ➔ httpProtocol 0 3 2
A ReCaptchaField.js ➔ callback 0 9 2
A ReCaptchaField.js ➔ form 0 3 1
A ReCaptchaField.js ➔ formOnSubmit 0 4 1
A ReCaptchaField.js ➔ submit 0 4 1
1
/** global: grecaptcha */
2
3
(function (window, document) {
4
    'use strict';
5
6
    function init() {
7
        var element = document.createElement('script'),
8
            target = document.querySelectorAll('script')[0];
9
        element.type = 'text/javascript';
10
        element.src = httpProtocol() + '://www.google.com/recaptcha/api.js?onload=reCaptchaOnloadCallback&render=explicit&hl='.concat(window.SS_LOCALE);
11
        target.parentNode.insertBefore(element, target);
12
    }
13
14
    function httpProtocol() {
15
        return 'https:' == document.location.protocol ? 'https' : 'http';
16
    }
17
18
    function callback() {
19
        var reCaptcha = document.querySelector('.g-recaptcha');
20
21
        if (reCaptcha.dataset.size === 'invisible') {
22
            form().addEventListener('submit', formOnSubmit);
23
        }
24
25
        grecaptcha.render(reCaptcha, reCaptcha.dataset);
26
    }
27
28
    function submit(token) {
29
        document.querySelector('#'.concat(window.ReCaptchaFormId, ' .g-recaptcha-response')).value = token;
30
        form().submit();
31
    }
32
33
    function form() {
34
        return document.querySelector('#'.concat(window.ReCaptchaFormId));
35
    }
36
37
    function formOnSubmit(event) {
38
        event.preventDefault();
39
        grecaptcha.execute();
40
    }
41
42
    domReady(init);
43
44
    window.reCaptchaOnloadCallback = callback;
45
    window.reCaptchaOnSubmit = submit;
46
})(window, document);
47
48