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.

Resources/public/js/loading-indication.js   A
last analyzed

Complexity

Total Complexity 6
Complexity/F 1.5

Size

Lines of Code 36
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 6
c 4
b 0
f 0
dl 0
loc 36
rs 10
cc 0
nc 1
mnd 1
bc 7
fnc 4
bpm 1.75
cpm 1.5
noi 4

3 Functions

Rating   Name   Duplication   Size   Complexity  
A loading-indication.js ➔ showLoadingIndicators 0 16 3
A loading-indication.js ➔ showSubmitIndicators 0 3 1
A loading-indication.js ➔ hideLoadingIndicators 0 5 1
1
(function ($, app) {
2
    'use strict';
3
4
    $(document)
5
        .on('pjax:send', showLoadingIndicators)
6
        .on('pjax:error', hideLoadingIndicators)
7
        .on('pjax:complete', hideLoadingIndicators)
8
        .on('submit', showSubmitIndicators);
9
10
    function showLoadingIndicators(event) {
11
        if (event.isDefaultPrevented()) {
12
            return;
13
        }
14
        var target = $(event.target).data('pjax-container');
15
16
        if (target == app.ROOT_CONTAINER_NAME) {
17
            $('#ajax-loading').fadeIn(1000);
18
        } else {
19
            var loading = $('<div class="contentLoading"><div class="img"></div></div>');
20
            loading.hide();
21
            $(event.target).css('position', 'relative');
22
            $(event.target).append(loading);
23
            loading.fadeIn(500);
24
        }
25
    }
26
27
    function hideLoadingIndicators(event) {
0 ignored issues
show
Unused Code introduced by
The parameter event is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
28
        $('#ajax-loading').fadeOut(100);
29
        $('.contentLoading').fadeOut(100);
30
        $(document).find('button[data-loading-text]').button('reset');
31
    }
32
33
    function showSubmitIndicators(event) {
0 ignored issues
show
Unused Code introduced by
The parameter event is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
34
        $form.find('button[data-loading-text]').button('loading');
0 ignored issues
show
Bug introduced by
The variable $form seems to be never declared. If this is a global, consider adding a /** global: $form */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
35
    }
36
})(jQuery, application);
0 ignored issues
show
Bug introduced by
The variable application seems to be never declared. If this is a global, consider adding a /** global: application */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
37