GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 2c3677...1bbaa4 )
by Benjamin
03:48
created

src/util/getRowBoundingRect.js   A

Complexity

Total Complexity 6
Complexity/F 6

Size

Lines of Code 28
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 0
wmc 6
c 1
b 1
f 1
nc 1
mnd 2
bc 3
fnc 1
dl 0
loc 28
rs 10
bpm 3
cpm 6
noi 1
1
export const getRowBoundingRect = (row, container = null) => {
0 ignored issues
show
Unused Code introduced by
The constant getRowBoundingRect seems to be never used. Consider removing it.
Loading history...
2
3
    if (!container) {
4
        container = row && row.offsetParent
5
            ? row.offsetParent.offsetParent
6
            : null;
7
    }
8
9
    if (!container) {
10
        return {};
11
    }
12
13
    const rowBCR = row.getBoundingClientRect();
14
    const containerBCR = container.getBoundingClientRect();
15
16
    const spaceBottom = containerBCR.bottom - rowBCR.bottom;
17
    const spaceTop = rowBCR.top - containerBCR.top;
18
19
    const maxHeight = Math.max(spaceBottom, spaceTop);
20
    const position = spaceTop > spaceBottom
21
        ? 'top'
22
        : 'bottom';
23
24
    return {
25
        maxHeight,
26
        position
27
    };
28
};
29