Passed
Push — master ( e04bae...01c4b6 )
by Konrad
02:33
created

lighthouse_garden/templates/assets/js/highlight.js   A

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 15
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 15
rs 10
c 0
b 0
f 0
mnd 1
bc 1
fnc 4
bpm 0.25
cpm 1.25
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A highlight.js ➔ highlightRow 0 7 5
1
$(function () {
2
    highlightRow();
3
    $('.share-link').click(function() {
4
        setTimeout(function(){ highlightRow(); }, 200);
5
6
    });
7
8
    function highlightRow() {
9
        const anchor = window.location.hash.substr(1);
10
            $('tr').removeClass('highlight');
11
        if (anchor !== '') {
12
            $('#' + anchor).addClass('highlight');
13
        }
14
    }
15
})