Sindarius / npm_gcodeviewer

Function with cyclomatic complexity higher than threshold JS-R1005
Anti-pattern
Minor
3 months ago8 months old
processLine has a cyclomatic complexity of 58 with "critical" risk
 712      this.updateFilePosition(Number.MAX_VALUE);
 713   }
 714
 715   async processLine(tokenString, lineNumber, filePosition, renderLine = true) { 716      //Remove the comments in the line
 717      let commentIndex = tokenString.indexOf(';');
 718      if (commentIndex > -1) {
g0g1 has a cyclomatic complexity of 62 with "critical" risk
 341      }
 342   }
 343
 344   g0g1(tokenString, lineNumber, filePosition, renderLine, command) { 345      let tokens = tokenString.split(/(?=[GXYZEFUVAB])/);
 346      const line = new gcodeLine();
 347      let hasXYMove = false;
updateLines has a cyclomatic complexity of 28 with "very-high" risk
 65      let lastPosition = 0; 
 66      let scrubbing = false; 
 67      let lastRendered = 0; 
 68      let updateLines = () => {  69         var colorData = lineMesh.getVerticesData(VertexBuffer.ColorKind); 
 70 
 71         if (!colorData) {