Total Complexity | 6 |
Complexity/F | 1.5 |
Lines of Code | 26 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 90% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | function getSimpleType(type) { |
||
2 | 54 | switch (type) { |
|
3 | case 'ExportDefaultSpecifier': |
||
4 | return 'default'; |
||
5 | default: |
||
6 | 54 | return 'named'; |
|
7 | } |
||
8 | } |
||
9 | |||
10 | 1 | module.exports = (declarations, resolve) => { |
|
|
|||
11 | 34 | const exps = []; |
|
12 | |||
13 | 34 | declarations.forEach(node => { |
|
14 | 54 | const specifiers = node.specifiers || []; |
|
15 | |||
16 | 54 | specifiers.forEach(specifier => { |
|
17 | 54 | exps.push({ |
|
18 | type: getSimpleType(specifier.type), |
||
19 | name: specifier.local.name, |
||
20 | exportedName: (specifier.exported || specifier.local).name, |
||
21 | }); |
||
22 | }); |
||
23 | }); |
||
24 | |||
25 | 34 | return exps; |
|
26 | }; |
||
27 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.