Found unused expression
61 * Default ViewManger Constructor
62 */
63 constructor() {
64 this.threeD; 65 this.view = new PaperView("c", this);
66
67 this.__grid = new AdaptiveGrid(this);
Found unused expression
31 this.camera;
32 this.controls;
33 this.scene;
34 this.renderer; 35 this.backgroundColor = Colors.BLUE_50;
36 this.mockup = null;
37 this.layers = null;
Found unused expression
30 this.container = renderContainer;
31 this.camera;
32 this.controls;
33 this.scene; 34 this.renderer;
35 this.backgroundColor = Colors.BLUE_50;
36 this.mockup = null;
Found unused expression
29 constructor(renderContainer) {
30 this.container = renderContainer;
31 this.camera;
32 this.controls; 33 this.scene;
34 this.renderer;
35 this.backgroundColor = Colors.BLUE_50;
Found unused expression
28export class ThreeDeviceRenderer {
29 constructor(renderContainer) {
30 this.container = renderContainer;
31 this.camera; 32 this.controls;
33 this.scene;
34 this.renderer;
Found unused expression
124
125 for (let i = 0; i < orderedKeys.length; i++) {
126 let color = decimalToLayerColor(i / orderedKeys.length, layer, orderedKeys);
127 new paper.Path.Circle({128 position: new paper.Point(0 + i * 1000, 2000),129 fillColor: layer[orderedKeys[i]],130 radius: 500131 });132 }
133}
134/**
Found unused expression
115 */
116export function renderAllColors(layer, orderedKeys) {
117 for (let i = 0; i < orderedKeys.length; i++) {
118 new paper.Path.Circle({119 position: new paper.Point(0 + i * 1000, 0),120 fillColor: layer[orderedKeys[i]],121 radius: 500122 });123 }
124
125 for (let i = 0; i < orderedKeys.length; i++) {
Found unused expression
21 * Default Constructor for BareViewManager object
22 */
23 constructor() {
24 this.threeD; 25 this.view = new PaperView("c", this);
26
27 this.__grid = new AdaptiveGrid(this);
Description
An unused expression that does not affect the state of the program indicates a logic error.
For example, if a programmer wants to increment the value of a variable a
by one, and intends to do so through this code:
let a = 0
a = a + 1
console.log(a) // output 1
But because of a typo, writes the following:
let a = 0
a + 1
console.log(a)
Here, the expression a + 1
does nothing meaningful in the program's runtime.
The expression is thus considered "unused" and should be removed.
Bad Practice
0
if(0) 0
{0}
f(0), {}
a, b()
c = a, b;
a() && function namedFunctionInExpressionContext () {f();}
(function anIncompleteIIFE () {});
injectGlobal`body{ color: red; }`
Recommended
{} // In this context, this is a block statement, not an object literal
{myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
function namedFunctionDeclaration () {}
(function aGenuineIIFE () {}());
f()
a = 0
new C
delete a.b
void a