Passed
Pull Request — master (#2)
by Luís
03:48 queued 02:00
created

src/js/services/Movies.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 17
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 0
nc 2
dl 0
loc 17
ccs 0
cts 8
cp 0
crap 0
rs 10
c 1
b 0
f 1
wmc 3
mnd 0
bc 3
fnc 3
bpm 1
cpm 1
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Movies.js ➔ Movies 0 7 1
A Movies.search 0 5 1
1
import App from "app";
2
3
function Movies() {
4
    this.serviceName = "Movies";
5
    this.basepath = "//www.omdbapi.com/";
6
7
    this.Request = App.ServicesContainer.get("AJAX");
8
    this.EM = App.EventManager;
9
}
10
11
Movies.prototype.search = function (term, onSuccess, onError) {
12
    this.Request.send('get', this.basepath, {s: term}, function (res) {
13
        onSuccess(res.body.Search || []);
14
    }, onError);
15
}
16
17
export default Movies;
18