js/lib/API/base.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 16
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 4
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2
mnd 1
bc 3
fnc 0
bpm 0
cpm 0
noi 3
1
/* 
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
7
8
/* global browser, chrome */
9
if (typeof API === "undefined") {
0 ignored issues
show
Bug introduced by
The variable API seems to be never initialized.
Loading history...
10
    var API = {};
11
}
12
/* jshint ignore:start */
13
API.api;
0 ignored issues
show
introduced by
The result of the property access to API.api is not used.
Loading history...
Bug introduced by
The variable API does not seem to be initialized in case typeof API === "undefined" on line 9 is false. Are you sure this can never be the case?
Loading history...
14
API.promise = true;     // Chrome does not return promises
15
/* jshint ignore:end */
16
17
// Workaround chrome's uniqueness
18
if (typeof browser === 'undefined') {
19
    API.api = chrome;
20
    API.promise = false;
21
}
22
else{
23
    API.api = browser;
24
}