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

etc/superuser/npm/index.js   A

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 38
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 28
c 0
b 0
f 0
dl 0
loc 38
rs 10
wmc 5
mnd 1
bc 1
fnc 4
bpm 0.25
cpm 1.25
noi 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ show_install 0 3 5
1
$(document).ready(function () {
2
  if (typeof Worker !== "undefined") {
3
    console.log("Web Worker Supported");
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
    const myWorker = new Worker("/assets/js/worker.js");
5
    myWorker.postMessage([100, 20]);
6
    myWorker.onmessage = function (e) {
7
      //result.textContent = e.data;
8
      console.log("Message received from worker", e);
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...
9
    };
10
  } else {
11
    console.error("Web Worker not support");
12
  }
13
14
  $(document).on("click", '[data-toggle="ajax"]', function (e) {
15
    e.preventDefault();
16
    const t = $(this);
17
    var method = t.data("method") || "POST";
18
    var data = t.data("postdata");
19
    var target = t.data("href");
20
    var success = t.data("success");
21
    var failed = t.data("failed");
22
    var complete = t.data("complete");
23
    ajx(
24
      {
25
        url: target,
26
        data: data,
27
        method: method,
28
      },
29
      success,
30
      failed,
31
      complete
32
    );
33
  });
34
});
35
36
function show_install(res) {
37
  console.log(res);
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...
38
}
39