Total Complexity | 4 |
Complexity/F | 1.33 |
Lines of Code | 18 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import $ from 'jquery' |
||
2 | |||
3 | let status |
||
4 | |||
5 | export function init (options) { |
||
6 | if (!status) { |
||
7 | const apiKey = options.apiKey |
||
8 | const callback = `googleMaps_${Date.now()}` |
||
9 | const url = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=${callback}` |
||
10 | status = new Promise((resolve, reject) => { |
||
|
|||
11 | window[callback] = () => { |
||
12 | resolve() |
||
13 | } |
||
14 | }) |
||
15 | $.getScript(url) |
||
16 | } |
||
17 | return status |
||
18 | } |
||
19 |
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.