Passed
Push — main ( fac3c3...502827 )
by Stefan
02:24
created

script/FormSelect.js   A

Complexity

Total Complexity 7
Complexity/F 1.75

Size

Lines of Code 28
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 16
mnd 3
bc 3
fnc 4
dl 0
loc 28
rs 10
bpm 0.75
cpm 1.75
noi 2
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A FormSelect.js ➔ onDatePicker 0 3 1
A FormSelect.js ➔ onTimePicker 0 3 1
A FormSelect.js ➔ resetInput 0 7 2
1
function onInsertDateTimeUser(id, strUsername)
2
{
3
    let oEdit = document.getElementById(id);
4
    if (oEdit) {
5
        let date = new Date();
6
        let strValue = oEdit.innerHTML = date.toLocaleString();
7
        if (strUsername != '') {
8
            strValue += ' / ' + strUsername;
9
        }
10
        oEdit.value = strValue;
11
    }
12
}
13
14
function onDatePicker(id)
0 ignored issues
show
Unused Code introduced by
The parameter id 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...
15
{
16
}
17
18
function onTimePicker(id)
0 ignored issues
show
Unused Code introduced by
The parameter id 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...
19
{
20
}
21
22
function resetInput(id)
23
{
24
    let oEdit = document.getElementById(id);
25
    if (oEdit) {
26
        oEdit.value = '';
27
    }
28
}
29