static/midgard.admin.asgard/jquery-copytree.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 16
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
mnd 1
bc 1
fnc 2
dl 0
loc 16
rs 10
bpm 0.5
cpm 1.5
noi 0
c 0
b 0
f 0
1
$.fn.tree_checker = function() {
2
    $(this).on('change', 'label > input[type="checkbox"]', function() {
3
        if (this.checked) {
4
            $(this).closest('li').find('li')
5
                .removeClass('readonly')
6
                .find('input').prop('disabled', false);
7
8
            $(this).closest('label').removeClass('deselected');
9
        } else {
10
            $(this).closest('li').find('li')
11
                .addClass('readonly')
12
                .find('input').prop('disabled', true);
13
            $(this).closest('label').addClass('deselected');
14
        }
15
    });
16
}
17