Passed
Pull Request — master (#9)
by Luís
09:02 queued 03:56
created

src/js/services/index.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 22
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 20%

Importance

Changes 5
Bugs 1 Features 4
Metric Value
cc 0
c 5
b 1
f 4
nc 1
dl 0
loc 22
ccs 1
cts 5
cp 0.2
crap 0
rs 10
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ ??? 0 1 1
1
import App from "app";
2
3
// application's services
4
import Request from "./ajax/Request";
5 4
import PersistentCache from "./cache/Persistent";
6
7
// example:
8
// constructor
9
// App.ServicesContainer.define("Service", require("./Service"))
10
11
// instance
12
// App.ServicesContainer.setInstance("Service", new Service());
13
14
15
// Default services
16
// interface to handle AJAX requests
17
App.ServicesContainer.define("AJAX", Request);
18
App.ServicesContainer.define("Cache", PersistentCache);
19
20
// configure AJAX to always ask for json
21
// You can ask for a new instance do get rid of this behaviour :)
22
App.ServicesContainer.get("AJAX").onStart(req => req.set("Accept", "application/json"));
23