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 ( af9c25...60cdc5 )
by Benjamin
02:43
created

src/util/getTreePathFromId.js (1 issue)

Labels
Severity
1
export const getTreePathFromId = (flatData, id) => {
2
    const res = [];
3
    const node = flatData.find(n => n.get('_id') === id);
4
5
    let lastParentId = node.get('_id');
6
7
    while (lastParentId !== undefined) {
8
        const parent = flatData.find(n => n.get('_id') === lastParentId);
0 ignored issues
show
The variable lastParentId is changed as part of the while loop for example by parent.get("_parentId") on line 12. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
9
10
        if (parent) {
11
            res.push(parent.get('_id'));
12
            lastParentId = parent.get('_parentId');
13
        }
14
15
        else {
16
            lastParentId = undefined;
17
        }
18
    }
19
20
    return res.reverse();
21
};
22