Test Setup Failed
Branch master (354693)
by Valery
09:34
created

assets/js/admin.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 17
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 0
1
'use strict';
2
3
$(document).ready(function () {
4
5
    let currentUrl = window.location.href;
6
7
    $('.sidebar .nav-item').each(function () {
8
9
        let sidebarLink = $('a', this).attr('href');
10
11
        if (currentUrl.indexOf(sidebarLink) !== -1) {
12
            $(this).addClass('active');
13
        }
14
15
    });
16
17
});
18