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.
Completed
Push — master ( 790382...790382 )
by Jacob
12s
created

tinymce/js/compatcheckmodule.js   A

Complexity

Total Complexity 11
Complexity/F 2.2

Size

Lines of Code 36
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 11
dl 0
loc 36
rs 10
c 0
b 0
f 0
cc 0
nc 264
mnd 2
bc 9
fnc 5
bpm 1.8
cpm 2.2
noi 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A M.tinymce_recordrtc.check_has_gum 0 7 2
B M.tinymce_recordrtc.check_secure 0 12 5
A M.tinymce_recordrtc.check_browser 0 7 2
1
// TinyMCE recordrtc library functions for checking browser compatibility.
2
// @package    tinymce_recordrtc.
3
// @author     Jesus Federico  (jesus [at] blindsidenetworks [dt] com).
4
// @author     Jacob Prud'homme (jacob [dt] prudhomme [at] blindsidenetworks [dt] com)
5
// @copyright  2016 onwards, Blindside Networks Inc.
6
// @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
7
8
// ESLint directives.
9
/* global tinyMCEPopup, alertWarning, alertDanger */
10
/* exported countdownTicker, playerDOM */
11
/* eslint-disable camelcase, no-alert */
12
13
// Scrutinizer CI directives.
14
/** global: navigator */
15
/** global: M */
16
/** global: tinyMCEPopup */
17
/** global: alertDanger */
18
/** global: alertWarning */
19
20
M.tinymce_recordrtc = M.tinymce_recordrtc || {};
21
22
// Show alert and close plugin if browser does not support WebRTC at all.
23
M.tinymce_recordrtc.check_has_gum = function() {
24
    if (!(navigator.mediaDevices && window.MediaRecorder)) {
25
        M.tinymce_recordrtc.show_alert('nowebrtc', function() {
26
            tinyMCEPopup.close();
27
        });
28
    }
29
};
30
31
// Notify and redirect user if plugin is used from insecure location.
32
M.tinymce_recordrtc.check_secure = function() {
33
    var isSecureOrigin = (window.location.protocol === 'https:') ||
34
                         (window.location.host.indexOf('localhost') !== -1);
35
36
    if (!isSecureOrigin && (window.bowser.chrome || window.bowser.opera)) {
37
        M.tinymce_recordrtc.show_alert('gumsecurity', function() {
38
            tinyMCEPopup.close();
39
        });
40
    } else if (!isSecureOrigin) {
41
        alertDanger.ancestor().ancestor().removeClass('hide');
42
    }
43
};
44
45
// Display "consider switching browsers" message if not using:
46
// - Firefox 29+;
47
// - Chrome 49+;
48
// - Opera 36+.
49
M.tinymce_recordrtc.check_browser = function() {
50
    if (!((window.bowser.firefox && window.bowser.version >= 29) ||
51
          (window.bowser.chrome && window.bowser.version >= 49) ||
52
          (window.bowser.opera && window.bowser.version >= 36))) {
53
        alertWarning.ancestor().ancestor().removeClass('hide');
54
    }
55
};
56