src/error.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 3
c 1
b 0
f 0
nc 2
mnd 1
bc 2
fnc 2
dl 0
loc 13
rs 10
bpm 1
cpm 1.5
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A error.js ➔ toString 0 3 2
1
function APIError(code, message, body) {
2
    this.code = code;
3
    this.message = (message || '');
4
    this.body = body;
5
}
6
7
Object.setPrototypeOf(APIError.prototype, Error.prototype);
8
APIError.prototype.name = 'APIError';
9
APIError.prototype.toString = function toString() {
10
    return this.message ? this.code + ' - ' + this.message : String(this.code);
11
};
12
13
export default APIError;