Sindarius / npm_gcodeviewer

Class methods should utilize this JS-0105
Anti-pattern
Minor
3 months agoa year old
Expected 'this' to be used by class method 'chunk'
 927      this.linesIndex = 0;
 928   }
 929
 930   chunk(arr, chunkSize) { 931      var R = [];
 932      for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize));
 933      return R;
Expected 'this' to be used by class method 'displayViewBox'
728      return data 
729   } 
730 
731   displayViewBox(show) { 732      showViewBox(show) 
733   } 
734 
Expected 'this' to be used by class method 'clamp'
643      this.simulationStopped(); 
644   } 
645 
646   clamp(value, min, max) { 647      return Math.min(Math.max(value, min), max); 
648   } 
649 
Expected 'this' to be used by class method 'goToGCodeLine'
609      return this.gcodeProcessor.currentLineNumber; 
610   } 
611 
612   goToGCodeLine(lineNumber) {} 613 
614   simulateToolPosition() { 
615      this.updateToolPosition(this.gcodeProcessor.nozzlePosition); 
Expected 'this' to be used by class method 'getBackgroundColor'
397      this.gcodeProcessor.setProgressColor(value); 
398   } 
399 
400   getBackgroundColor() { 401      let color = localStorage.getItem('sceneBackgroundColor'); 
402      if (color === null) { 
403         color = '#000000';