Test Setup Failed
Push — test ( 23ab4f...3d10a7 )
by Jonathan
01:57
created

resources/compiled/rich_microtime.js   A

Complexity

Total Complexity 6
Complexity/F 2

Size

Lines of Code 1
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
wmc 6
nc 235
mnd 2
bc 4
fnc 3
dl 0
loc 1
rs 10
bpm 1.3333
cpm 2
noi 3
c 0
b 0
f 0
1
void 0===window.kintRichMicrotimeInitialized&&(window.kintRichMicrotimeInitialized=1,window.addEventListener("load",function(){"use strict";var c={},i=Array.prototype.slice.call(document.querySelectorAll("[data-kint-microtime-group]"),0);i.forEach(function(i){if(i.querySelector(".kint-microtime-lap")){var t=i.getAttribute("data-kint-microtime-group"),e=parseFloat(i.querySelector(".kint-microtime-lap").innerHTML),r=parseFloat(i.querySelector(".kint-microtime-avg").innerHTML);void 0===c[t]&&(c[t]={}),(void 0===c[t].min||c[t].min>e)&&(c[t].min=e),(void 0===c[t].max||c[t].max<e)&&(c[t].max=e),c[t].avg=r}}),(i=Array.prototype.slice.call(document.querySelectorAll("[data-kint-microtime-group]>.kint-microtime-lap"),0)).forEach(function(i){var t,e=i.parentNode.getAttribute("data-kint-microtime-group"),r=parseFloat(i.innerHTML),o=c[e].avg,a=c[e].max,n=c[e].min;r===(i.parentNode.querySelector(".kint-microtime-avg").innerHTML=o)&&r===n&&r===a||(o<r?(t=(r-o)/(a-o),i.style.background="hsl("+(40-40*t)+", 100%, 65%)"):(t=o===n?0:(o-r)/(o-n),i.style.background="hsl("+(40+80*t)+", 100%, 65%)"))})}));
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
Unused Code introduced by
The assignment to variable i seems to be never used. Consider removing it.
Loading history...
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
2