CIDARLAB / 3DuF

Variable used before definition JS-0129
Bug risk
Major
36 occurrences in this check
'createCloseButton' was used before it was defined
324    table.appendChild(head);
325    var body = createFeatureTableBody(typeString, setString);
326    table.appendChild(body);
327    var closeButton = createCloseButton();328    closeButton.style.position = "absolute";
329    closeButton.style.right = "0px";
330    closeButton.style.top = "0px";
'onMouseUp' was used before it was defined
359
360        if (state !== STATE.NONE) {
361            document.addEventListener("mousemove", onMouseMove, false);
362            document.addEventListener("mouseup", onMouseUp, false);363            scope.dispatchEvent(startEvent);
364        }
365    }
'onMouseMove' was used before it was defined
358        }
359
360        if (state !== STATE.NONE) {
361            document.addEventListener("mousemove", onMouseMove, false);362            document.addEventListener("mouseup", onMouseUp, false);
363            scope.dispatchEvent(startEvent);
364        }
'getAutoRotationAngle' was used before it was defined
251        phi = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);
252
253        if (this.autoRotate && state === STATE.NONE) {
254            this.rotateLeft(getAutoRotationAngle());255        }
256
257        theta += thetaDelta;
'getZoomScale' was used before it was defined
220
221    this.dollyOut = function(dollyScale) {
222        if (dollyScale === undefined) {
223            dollyScale = getZoomScale();224        }
225
226        if (scope.object instanceof THREE.PerspectiveCamera) {
'getZoomScale' was used before it was defined
204
205    this.dollyIn = function(dollyScale) {
206        if (dollyScale === undefined) {
207            dollyScale = getZoomScale();208        }
209
210        if (scope.object instanceof THREE.PerspectiveCamera) {
'getAutoRotationAngle' was used before it was defined
147
148    this.rotateUp = function(angle) {
149        if (angle === undefined) {
150            angle = getAutoRotationAngle();151        }
152
153        phiDelta -= angle;
'getAutoRotationAngle' was used before it was defined
139
140    this.rotateLeft = function(angle) {
141        if (angle === undefined) {
142            angle = getAutoRotationAngle();143        }
144
145        thetaDelta -= angle;
'TwoPointRoundedLine' was used before it was defined
130    var matrix = new THREE.Matrix4();
131    core.applyMatrix(matrix.makeTranslation(w / 2, h / 2, height / 2));
132    core.applyMatrix(matrix.makeTranslation(bottomLeft[0], bottomLeft[1], 0));
133    var left = TwoPointRoundedLine({134        start: bottomLeft,
135        end: topLeft,
136        width: borderWidth,
'TwoPointRoundedLine' was used before it was defined
136        width: borderWidth,
137        height: height
138    });
139    var top = TwoPointRoundedLine({140        start: topLeft,
141        end: topRight,
142        width: borderWidth,
'TwoPointRoundedLine' was used before it was defined
142        width: borderWidth,
143        height: height
144    });
145    var right = TwoPointRoundedLine({146        start: topRight,
147        end: bottomRight,
148        width: borderWidth,
'TwoPointRoundedLine' was used before it was defined
148        width: borderWidth,
149        height: height
150    });
151    var down = TwoPointRoundedLine({152        start: bottomRight,
153        end: bottomLeft,
154        width: borderWidth,
'TwoPointRoundedBox' was used before it was defined
 49    let end = params.end;
 50    let borderWidth = params.borderWidth;
 51    let height = params.height;
 52    var box = TwoPointRoundedBox({ 53        start: start,
 54        end: end,
 55        borderWidth: borderWidth,
'TwoPointRoundedBox' was used before it was defined
 30    let end = [start[0] + width, start[1] + length];
 31    let borderWidth = 0;
 32    let height = params.height;
 33    var box = TwoPointRoundedBox({ 34        start: start,
 35        end: end,
 36        borderWidth: borderWidth,
'TwoPointRoundedLine' was used before it was defined
  7    let end = params.end;
  8    let width = params.width;
  9    let height = params.height;
 10    var box = TwoPointRoundedLine({ 11        start: start,
 12        end: end,
 13        width: width,
'renderEdge' was used before it was defined
 34        let rendererInfo = renderTextTarget;
 35        return rendererInfo;
 36    } else if (typeString === "EDGE") {
 37        return renderEdge; 38    } else {
 39        let rendererInfo = FeatureSets.getRender2D(typeString, setString);
 40        return rendererInfo;
'renderTextTarget' was used before it was defined
 31
 32export function getFeatureRenderer(typeString, setString) {
 33    if (typeString === "TEXT") {
 34        let rendererInfo = renderTextTarget; 35        return rendererInfo;
 36    } else if (typeString === "EDGE") {
 37        return renderEdge;
'renderDXFObjects' was used before it was defined
  7export function renderCustomComponentFeature(feature, color) {
  8    let position = feature.getValue("position");
  9    let rotation = feature.getValue("rotation");
 10    let render = renderDXFObjects(feature.dxfObjects); 11    render.translate(new paper.Point(position[0], position[1]));
 12    render.rotate(rotation);
 13    render.fillColor = color;
'renderDXFObjects' was used before it was defined
 20    let color = params["color"];
 21    let rotation = params["rotation"];
 22    let p = new paper.Point(position[0], position[1]);
 23    let render = renderDXFObjects(customcomponent.dxfData); 24
 25    render.fillColor = color;
 26    render.fillColor.alpha = 0.5;
'drawEllipse' was used before it was defined
200                processPolyLine(geometryGraph, dxfobject.getData());
201            }
202        } else if (dxfobject.getType() === "ELLIPSE") {
203            closedshapes.push(drawEllipse(dxfobject.getData()));204        } else if (dxfobject.getType() === "CIRCLE") {
205            closedshapes.push(drawCircle(dxfobject.getData()));
206        } else if (dxfobject.getType() === "SPLINE") {
'drawCircle' was used before it was defined
202        } else if (dxfobject.getType() === "ELLIPSE") {
203            closedshapes.push(drawEllipse(dxfobject.getData()));
204        } else if (dxfobject.getType() === "CIRCLE") {
205            closedshapes.push(drawCircle(dxfobject.getData()));206        } else if (dxfobject.getType() === "SPLINE") {
207            alert("The current version of the DXF Parser does not support SPLINE objects. Support will be added in future versions");
208            throw new Error("Unsupported render object");
'drawArc' was used before it was defined
260        // Figure out what entity this is and then based on that do the drawing
261        let mesh;
262        if (dxfobject.getType() === "ARC") {
263            path.addChild(drawArc(dxfobject.getData()));264        } else if (dxfobject.getType() === "LWPOLYLINE" || dxfobject.getType() === "LINE" || dxfobject.getType() === "POLYLINE") {
265            path.addChild(drawLine(dxfobject.getData()));
266        } else if (dxfobject.getType() === "SPLINE") {
'drawLine' was used before it was defined
262        if (dxfobject.getType() === "ARC") {
263            path.addChild(drawArc(dxfobject.getData()));
264        } else if (dxfobject.getType() === "LWPOLYLINE" || dxfobject.getType() === "LINE" || dxfobject.getType() === "POLYLINE") {
265            path.addChild(drawLine(dxfobject.getData()));266        } else if (dxfobject.getType() === "SPLINE") {
267            path.addChild(drawSpline(dxfobject.getData()));
268        } else if (dxfobject.getType() === "ELLIPSE") {
'drawSpline' was used before it was defined
264        } else if (dxfobject.getType() === "LWPOLYLINE" || dxfobject.getType() === "LINE" || dxfobject.getType() === "POLYLINE") {
265            path.addChild(drawLine(dxfobject.getData()));
266        } else if (dxfobject.getType() === "SPLINE") {
267            path.addChild(drawSpline(dxfobject.getData()));268        } else if (dxfobject.getType() === "ELLIPSE") {
269            path.addChild(drawEllipse(dxfobject.getData()));
270        } else if (dxfobject.getType() === "CIRCLE") {
'drawEllipse' was used before it was defined
266        } else if (dxfobject.getType() === "SPLINE") {
267            path.addChild(drawSpline(dxfobject.getData()));
268        } else if (dxfobject.getType() === "ELLIPSE") {
269            path.addChild(drawEllipse(dxfobject.getData()));270        } else if (dxfobject.getType() === "CIRCLE") {
271            path.addChild(drawCircle(dxfobject.getData()));
272        } else {