Sindarius / npm_gcodeviewer

Initialization in variable declarations against recommended approach JS-0119
Anti-pattern
Minor
3 months agoa year old
Variable 'renderer' should be initialized on declaration
 898         });
 899      }
 900
 901      let renderer; 902      if (this.renderVersion === RenderMode.Line || this.renderVersion === RenderMode.Point) {
 903         renderer = new LineRenderer(scene, this.specularColor, this.loadingProgressCallback, this.renderFuncs, this.tools, this.meshIndex);
 904      } else if (this.renderVersion === RenderMode.Block) {
Variable 'tokens' should be initialized on declaration
 718      if (commentIndex > -1) {
 719         tokenString = tokenString.substring(0, commentIndex - 1).trim();
 720      }
 721      let tokens; 722
 723      tokenString = tokenString.toUpperCase();
 724      let commands = tokenString.match(/[GM]+[0-9.]+/g); //|S+
Variable 'vertextMultiplier' should be initialized on declaration
 277      }
 278
 279      for (let renderModeIdx = renderStartIndex; renderModeIdx < 4; renderModeIdx++) {
 280         let vertextMultiplier; 281         switch (renderModeIdx) {
 282            case 1:
 283               vertextMultiplier = 24;
Variable 'ViewBoxCallback' should be initialized on declaration
 89  box.material= edgeMaterial; 
 90} 
 91 
 92var ViewBoxCallback;  93 
 94export function registerViewBoxCallback(func) { 
 95  ViewBoxCallback = func; 
Variable 'json' should be initialized on declaration
46   } 
47 
48   static fromJson(jsonString) { 
49      let json; 50      if (typeof jsonString === 'object') { 
51         json = jsonString; 
52      } else {