Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
27 | let parse = function parse(response) { |
||
|
|||
28 | let body = response.success; |
||
29 | for (let parser of parsers) { |
||
30 | try { |
||
31 | let promise = parser.parse(body); |
||
32 | return Promise.resolve(promise); // Resume loop if not Error has been thrown |
||
33 | } catch (error) { |
||
34 | continue; |
||
35 | } |
||
36 | } |
||
37 | let message = `Unknown error. Codingame may have changed its API. Please contact 'codingame-connector' developer.`; |
||
38 | let error = new Error(message); |
||
39 | return Promise.reject(error); |
||
40 | }; |
||
41 | |||
45 |
This check looks for variables that are declared in multiple lines. There may be several reasons for this.
In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.
If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.