web/admin/js/eapSorter.js   A
last analyzed

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 35
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 27
mnd 0
bc 0
fnc 7
dl 0
loc 35
rs 10
bpm 0
cpm 1
noi 4
c 0
b 0
f 0
1
/*
2
 * *****************************************************************************
3
 * Contributions to this work were made on behalf of the GÉANT project, a 
4
 * project that has received funding from the European Union’s Framework 
5
 * Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus),
6
 * Horizon 2020 research and innovation programme under Grant Agreements No. 
7
 * 691567 (GN4-1) and No. 731122 (GN4-2).
8
 * On behalf of the aforementioned projects, GEANT Association is the sole owner
9
 * of the copyright in all material which was developed by a member of the GÉANT
10
 * project. GÉANT Vereniging (Association) is registered with the Chamber of 
11
 * Commerce in Amsterdam with registration number 40535155 and operates in the 
12
 * UK as a branch of GÉANT Vereniging.
13
 * 
14
 * Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands. 
15
 * UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
16
 *
17
 * License: see the web/copyright.inc.php file in the file structure or
18
 *          <base_url>/copyright.php after deploying the software
19
 */
20
21
$(function () {
22
    $("#sortable1").sortable({
23
        connectWith: "ol.eapmethods",
24
        tolerance: 'pointer',
25
        out: function (event, ui) {
26
            ui.item.removeClass("eap1");
27
        },
28
        stop: function (event, ui) {
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...
Unused Code introduced by
The parameter ui 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...
29
            $(".eapm").removeAttr('value');
30
            $(".eapmv").removeAttr('value');
31
            $("#sortable1").children().each(function (index) {
32
                var v = $(this).html();
33
                $("#EAP-" + v).val(v);
34
                $("#EAP-" + v + "-priority").val(index + 1);
35
            });
36
        }
37
    }).disableSelection();   
38
    
39
    $("#sortable2").sortable({
40
        connectWith: "ol.eapmethods",
41
        tolerance: 'pointer',
42
        out: function (event, ui) {
43
            ui.item.addClass("eap1");
44
        },
45
        stop: function (event, ui) {
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...
Unused Code introduced by
The parameter ui 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...
46
            $(".eapm").removeAttr('value');
47
            $(".eapmv").removeAttr('value');
48
            $("#sortable1").children().each(function (index) {
49
                var v = $(this).html();
50
                $("#EAP-" + v).val(v);
51
                $("#EAP-" + v + "-priority").val(index + 1);
52
            });
53
        }
54
    }).disableSelection();
55
});
56