dist-backup/js/app_MenuTabClick.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 2.5

Size

Lines of Code 15
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 5
mnd 3
bc 3
fnc 2
bpm 1.5
cpm 2.5
noi 1
1
window.addEventListener('load', function() {
2
    setTimeout(() => {
3
        if(window.location.hash) {
4
            const els = document.querySelectorAll('[aria-controls="'+window.location.hash.substring(1)+'"]');
5
            if(els.length) {
6
                el = els[0];
0 ignored issues
show
Bug introduced by
The variable el seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.el.
Loading history...
7
                if ("#"+el.getAttribute('aria-controls') === window.location.hash) {
8
                    el.firstChild.click();
9
                    el.firstChild.style.fontWeight = 'bold';
10
                    el.firstChild.style.color = '#0071c4';
11
                };
12
            }
13
        }
14
    }, 500);
15
});
16