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.
Passed
Push — master ( 65d67e...988c58 )
by
unknown
08:37
created

src/Resources/public/js/vendor-position.js   A

Complexity

Total Complexity 9
Complexity/F 1.13

Size

Lines of Code 47
Function Count 8

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 9
mnd 1
bc 1
fnc 8
bpm 0.125
cpm 1.125
noi 0
1
(function ($) {
2
    'use strict';
3
4
    $.fn.extend({
5
        moveVendor(positionInput) {
6
            const vendorRows = [];
7
            const element = this;
8
9
            element.api({
10
                method: 'PUT',
11
                beforeSend(settings) {
12
                    /* eslint-disable-next-line no-param-reassign */
13
                    settings.data = {
14
                        vendors: vendorRows,
15
                        _csrf_token: element.data('csrf-token'),
16
                    };
17
18
                    return settings;
19
                },
20
                onSuccess() {
21
                    window.location.reload();
22
                },
23
            });
24
25
            positionInput.on('input', (event) => {
26
                const input = $(event.currentTarget);
27
                const vendorId = input.data('id');
28
                const row = vendorRows.find(({ id }) => id === vendorId);
29
30
                if (!row) {
31
                    vendorRows.push({
32
                        id: vendorId,
33
                        position: input.val(),
34
                    });
35
                } else {
36
                    row.position = input.val();
37
                }
38
            });
39
        }
40
    });
41
})(jQuery);
42
43
(function($) {
44
    $(document).ready(function () {
45
        $('.odiseo-update-vendors').moveVendor($('.odiseo-vendor-position'));
46
    });
47
})(jQuery);
48