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/modal.js   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 38

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 38
rs 8.8571
cc 1
nc 1
nop 2

3 Functions

Rating   Name   Duplication   Size   Complexity  
A modal.js ➔ $ 0 7 1
A modal.js ➔ onModalPjaxSend 0 6 1
A modal.js ➔ closeModalIfNeeded 0 11 2
1
(function ($, app) {
2
    'use strict';
3
4
    $.extend(app, {
5
        PJAX_MODAL_SELECTOR: '#pjaxModal',
6
        PJAX_MODAL_CONTAINER: 'modal'
7
    });
8
9
    $(function () {
10
        $(app.PJAX_MODAL_SELECTOR)
11
            .on('pjax:send', onModalPjaxSend)
12
            .on('hidden.bs.modal', function () {
13
                $(this).find('.modal-content').html('');
14
            });
15
    });
16
17
    $(document).on('pjax:beforeSend', closeModalIfNeeded);
18
19
    function closeModalIfNeeded(xhr, options, settings) {
20
        // надо ли закрывать модальное окно после завершения запроса?
21
        var $modal = $(app.PJAX_MODAL_SELECTOR),
22
            closeModal;
23
24
        closeModal = settings.target != app.PJAX_MODAL_CONTAINER;
25
        // закрываем модальное окно
26
        if (closeModal) {
27
            $modal.modal('hide');
28
        }
29
    }
30
31
    function onModalPjaxSend(event, xhr, options) {
32
        $(app.PJAX_MODAL_SELECTOR)
33
            .modal('show')
34
            .find('[data-pjax-container="' + app.PJAX_MODAL_CONTAINER + '"]')
35
            .data(app.PJAX_REDIRECT_TARGET_PARAMETER, options.redirectTarget);
36
    }
37
38
})(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...
39