Passed
Push — master ( d19b6f...b2bfd0 )
by Jonathan
02:31 queued 10s
created

module-manager.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
export class ModuleManager {
2
    constructor() {
3
        this.initCheckboxListener()
4
    }
5
6
    initCheckboxListener() {
7
        const domainSlug = $('meta[name="domain"]').attr('content')
8
9
        $("input[type='checkbox'].module-activation").on('click', (event) => {
10
            let element = event.currentTarget
11
            let url = laroute.route('uccello.settings.module.activation', { domain: domainSlug })
0 ignored issues
show
Bug introduced by
The variable laroute seems to be never declared. If this is a global, consider adding a /** global: laroute */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
12
13
            $.post(url, {
14
                _token: $("meta[name='csrf-token']").attr('content'),
15
                src_module: $(element).data('module'),
16
                active: $(element).is(':checked') === true ? '1' : '0'
17
            }).fail((error) => {
0 ignored issues
show
Unused Code introduced by
The parameter error is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
18
                swal('Error', null, 'error')
19
            })
20
        })
21
    }
22
}