Passed
Push — master ( e95921...ddbd1b )
by Dimas
13:28 queued 05:15
created

etc/superuser/users/create.js   A

Complexity

Total Complexity 6
Complexity/F 3

Size

Lines of Code 21
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 6
mnd 4
bc 4
fnc 2
bpm 2
cpm 3
noi 0
1
// register user
2
if ($("form#regist").length) {
3
  $("form#regist").submit(function (e) {
4
    e.preventDefault();
5
    $.post(
6
      location.protocol + "//" + location.host + "/signup",
7
      $(this).serialize(),
8
      function (res) {
9
        if (res) {
10
          if (typeof res == "object") {
11
            if (res.hasOwnProperty("success") && res.success) {
12
              toastr.success(
13
                "User created successfully".capitalize(),
14
                "user management".toUpperCase()
15
              );
16
            }
17
          }
18
        }
19
      }
20
    );
21
  });
22
}
23