Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( d3ad00...acd091 )
by Pierre
04:27
created

index.js ➔ ... ➔ Module.extend.initialize   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 48

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 48
rs 9.125
c 0
b 0
f 0
1
define(
2
    ['core/module', 'lodash', 'marionette', 'payments/payment/model', 'template', 'payments/payment/controller', 'handlebars.runtime'],
3
    function(Module, _, Mn, PaymentModel, Template, Controller, Handlebars) {
4
        "use strict";
5
6
        return Module.extend({
7
            regions: {
8
                'paymentMethodData': '#payment-method-settings',
9
                'paymentMethodList': '.left-sidebar'
10
            },
11
            initialize: function() {
12
                var module = this;
13
14
                var model = new PaymentModel,
0 ignored issues
show
Coding Style introduced by
The constructor invocation misses ().

This requirement purely is a coding style requirement and is not required to run on JavaScript engines:

new Date; // Bad
new Date(); // Good
Loading history...
15
                    controller = new Controller(module, model);
16
17
                Handlebars.registerPartial('menuItem', Template.payment.menu_item);
18
19
                var view = Mn.View.extend({
20
                    template: Template.payment.menu,
21
                    el: '#payment-method-tabs',
22
                    router: null,
23
                    modelEvents: {
24
                        sync: 'render'
25
                    },
26
                    initialize: function() {
27
                        this.model.fetch({success: _.bind(this.setRoutes, this)});
28
                    },
29
                    setRoutes: function() {
30
                        var router = this.getOption('router'),
31
                            enabled = _.clone(this.model.get('enabled')),
32
                            disabled = _.clone(this.model.get('disabled'));
33
34
                        var initialRoute = _.head(_.values(enabled));
35
36
                        if (_.isUndefined(initialRoute)) {
37
                            initialRoute = _.head(_.values(disabled));
38
                        }
39
40
                        _.each(_.merge(enabled, disabled), function(item) {
41
                            router.appRoute(item, 'showMethod');
42
                        });
43
44
                        setTimeout(function() {
45
                            controller.showMethod(initialRoute);
46
                        }, 0);
47
                    }
48
                });
49
50
                var menuView = new view({
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like view should be capitalized.
Loading history...
51
                    model: model,
52
                    router: new Mn.AppRouter({
53
                        controller: Controller(module, model)
54
                    })
55
                });
56
57
                this.app.showChildView('paymentMethodList', menuView);
58
            }
59
        });
60
    });