form-event.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 19
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
mnd 0
bc 0
fnc 2
dl 0
loc 19
rs 10
bpm 0
cpm 1
noi 4
c 0
b 0
f 0
1
// formToObject
2
function formEvent(form, rest_form, error, success) {
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...
Unused Code introduced by
The parameter success 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...
3
    console.log(form);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
4
5
    form.addEventListener("submit", function (event) {
6
        console.log(this);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
7
8
        var data = formToObject(this);
9
        var method = data.method;
10
        delete data.method;
11
        delete data.submit;
12
13
        console.log(method);
14
15
        rest_form.byMethod(method, data);
16
        console.log(data);
17
18
        event.preventDefault();
19
    });
20
}
21