Showing 2,136 of 2,138 total issues
Function arc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
contextPrototype.arc = function(aX, aY, aRadius,
aStartAngle, aEndAngle, aClockwise) {
Avoid deeply nested control flow statements. Open
if (tick) label = tick[1];
Function drawSeriesPie
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
drawSeriesPie: function(series) {
if (this.options.pie.drawn) return;
var ctx = this.ctx,
options = this.options,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if(!tick.label || tick.label.length == 0 ||
(this.plotOffset.left + this.tHoz(tick.v, axis) < 0) ||
(this.plotOffset.left + this.tHoz(tick.v, axis) > this.canvasWidth)) continue;
Avoid deeply nested control flow statements. Open
if (!tick.label || tick.label.length == 0 ||
(this.plotOffset.top + this.tVert(tick.v, axis) < 0) ||
(this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
Function setSelectionPos
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setSelectionPos: function(pos, event) {
var options = this.options,
offset = $(this.overlay).cumulativeOffset();
if(options.selection.mode.indexOf('x') == -1){
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
for (var j in stackedSums) {
newmax = Math.max(stackedSums[j], newmax);
}
Function focus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
focus: function(event, element) {
if (event)
event.stop();
// Multi selection with shift
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if(b.stacked && b.horizontal){
for (j = 0; j < s.data.length; j++) {
if (b.show && b.stacked) {
var x = s.data[j][0]+'';
stackedSums[x] = (stackedSums[x] || 0) + s.data[j][1];
Avoid deeply nested control flow statements. Open
if (!tick.label || tick.label.length == 0 ||
(this.plotOffset.top + this.tVert(tick.v, axis) < 0) ||
(this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
Avoid deeply nested control flow statements. Open
for (j = 0; j < s.data.length; j++) {
if (s.bars.show && s.bars.stacked) {
var x = s.data[j][0]+'';
stackedSums[x] = (stackedSums[x] || 0) + s.data[j][1];
lastSerie = s;
Avoid deeply nested control flow statements. Open
for (var j in stackedSums) {
newmax = Math.max(stackedSums[j], newmax);
}
Avoid deeply nested control flow statements. Open
if(!tick.label || tick.label.length == 0 ||
(this.plotOffset.left + this.tHoz(tick.v, axis) < 0) ||
(this.plotOffset.left + this.tHoz(tick.v, axis) > this.canvasWidth)) continue;
Avoid deeply nested control flow statements. Open
if(p.charAt(1) == 'e') pos += 'right:' + (m + plotOffset.right) + 'px;';
else if(p.charAt(1) == 'w') pos += 'left:' + (m + plotOffset.left) + 'px;';
Avoid deeply nested control flow statements. Open
if (tick) label = tick[1];
Avoid deeply nested control flow statements. Open
if(x < xaxis.datamin) xaxis.datamin = x;
else if(x > xaxis.datamax) xaxis.datamax = x;
Avoid deeply nested control flow statements. Open
if(p.charAt(1) == 'e') pos += 'right:' + (m + plotOffset.right) + 'px;';
else if(p.charAt(1) == 'w') pos += 'left:' + (m + plotOffset.left) + 'px;';
Avoid deeply nested control flow statements. Open
if (!tick.label || tick.label.length == 0 ||
(this.plotOffset.top + this.tVert(tick.v, axis) < 0) ||
(this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
Avoid deeply nested control flow statements. Open
if(p.charAt(0) == 'n') pos += 'top:' + (m + plotOffset.top) + 'px;';
else if(p.charAt(0) == 's') pos += 'bottom:' + (m + plotOffset.bottom) + 'px;';
Avoid deeply nested control flow statements. Open
if (!b.horizontal && (b.barWidth + axis.datamax > newmax))
newmax = axis.max + (b.centered ? b.barWidth/2 : b.barWidth);