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

Complexity

Total Complexity 20
Complexity/F 1.33

Size

Lines of Code 62
Function Count 15

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
nc 1
dl 0
loc 62
rs 10
c 0
b 0
f 0
wmc 20
mnd 1
bc 25
fnc 15
bpm 1.6666
cpm 1.3333
noi 0

5 Functions

Rating   Name   Duplication   Size   Complexity  
A API.cookies.remove 0 12 2
A API.cookies.set 0 12 2
A API.cookies.getAllCookieStores 0 12 2
A API.cookies.getAll 0 12 2
A API.cookies.get 0 12 2
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 API */
9
10
API.cookies = {
11
    get: function (details) {
12
        if (API.promise) {
13
            return API.api.cookies.get(details);
14
        }
15
        else {
16
            return new C_Promise(function () {
17
                API.api.cookies.get(details, (function (cookie) {
18
                    this.call_then(cookie);
19
                }).bind(this));
20
            });
21
        }
22
    },
23
    getAll: function (details) {
24
        if (API.promise) {
25
            return API.api.cookies.getAll(details);
26
        }
27
        else {
28
            return new C_Promise(function () {
29
                API.api.cookies.getAll(details, (function (cookie) {
30
                    this.call_then(cookie);
31
                }).bind(this));
32
            });
33
        }
34
    },
35
    set: function (details) {
36
        if (API.promise) {
37
            return API.api.cookies.set(details);
38
        }
39
        else {
40
            return new C_Promise(function () {
41
                API.api.cookies.set(details, (function (cookie) {
42
                    this.call_then(cookie);
43
                }).bind(this));
44
            });
45
        }
46
    },
47
    remove: function (details) {
48
        if (API.promise) {
49
            return API.api.cookies.remove(details);
50
        }
51
        else {
52
            return new C_Promise(function () {
53
                API.api.cookies.remove(details, (function (cookie) {
54
                    this.call_then(cookie);
55
                }).bind(this));
56
            });
57
        }
58
    },
59
    getAllCookieStores: function (details) {
60
        if (API.promise) {
61
            return API.api.cookies.getAllCookieStores(details);
62
        }
63
        else {
64
            return new C_Promise(function () {
65
                API.api.cookies.getAllCookieStores(details, (function (cookie) {
66
                    this.call_then(cookie);
67
                }).bind(this));
68
            });
69
        }
70
    }
71
};