Found unused expression
410function contains (parent, descendant) {
411 try {
412 // Firefox inserts inaccessible nodes around video elements
413 descendant.parentNode // eslint-disable-line no-unused-expressions414 } catch (e) {
415 return false
416 }
Found unused expression
85 * requestId: ?number
86 * }}
87 */
88 u2f.U2fRequest 89
90 /**
91 * A message for registration responses
Found unused expression
95 * requestId: ?number
96 * }}
97 */
98 u2f.U2fResponse 99
100 /**
101 * An error object for responses
Found unused expression
104 * errorMessage: ?string
105 * }}
106 */
107 u2f.Error108
109 /**
110 * Data object for a single sign request.
Found unused expression
110 * Data object for a single sign request.
111 * @typedef {enum {BLUETOOTH_RADIO, BLUETOOTH_LOW_ENERGY, USB, NFC, USB_INTERNAL}}
112 */
113 u2f.Transport114
115 /**
116 * Data object for a single sign request.
Found unused expression
116 * Data object for a single sign request.
117 * @typedef {Array<u2f.Transport>}
118 */
119 u2f.Transports120
121 /**
122 * Data object for a single sign request.
Found unused expression
127 * appId: string
128 * }}
129 */
130 u2f.SignRequest131
132 /**
133 * Data object for a sign response.
Found unused expression
137 * clientData: string
138 * }}
139 */
140 u2f.SignResponse141
142 /**
143 * Data object for a registration request.
Found unused expression
157 * appId: string
158 * }}
159 */
160 u2f.RegisterResponse161
162 /**
163 * Data object for a registered key.
Found unused expression
168 * appId: ?string
169 * }}
170 */
171 u2f.RegisteredKey172
173 /**
174 * Data object for a get API register response.
Found unused expression
176 * js_api_version: number
177 * }}
178 */
179 u2f.GetJsApiVersionResponse180
181 // Low level MessagePort API support
182
Found unused expression
146 * challenge: string
147 * }}
148 */
149 u2f.RegisterRequest150
151 /**
152 * Data object for a registration response.
Found unused expression
55 needInvoke = true
56 ctx = ctx || this
57
58 timer || (function () {59 if (needInvoke) {60 fn.apply(ctx, args)61 needInvoke = false62 timer = setTimeout(arguments.callee, timeout)63 } else {64 timer = null65 }66 })()67 }
68 }
69
Found unused expression
35 clearTimeout(timer)
36
37 timer = setTimeout(function () {
38 invokeAsap || fn.apply(ctx, args)39 timer = null
40 }, timeout)
41 }
Found unused expression
30 const args = arguments
31 ctx = ctx || this
32
33 invokeAsap && !timer && fn.apply(ctx, args)34
35 clearTimeout(timer)
36
Found unused expression
150 // True to bring the series of the highlighted point to the front
151 // of other series.
152 this.bringSeriesToFront = false
153 this._tooltipElem154 this.isHighlighting = false
155 this.currentNeighbor = null
156
Found unused expression
73 this.angle = 0
74 this.textAlign = 'start'
75 this.textBaseline = 'alphabetic'
76 this.text 77 this.width
78 this.height
79 this.pt2px = 1.28
Found unused expression
75 this.textBaseline = 'alphabetic'
76 this.text
77 this.width
78 this.height 79 this.pt2px = 1.28
80
81 $.extend(true, this, options)
Found unused expression
74 this.textAlign = 'start'
75 this.textBaseline = 'alphabetic'
76 this.text
77 this.width 78 this.height
79 this.pt2px = 1.28
80
Found unused expression
95 this._elem
96 this._ctx
97 this._plotWidth
98 this._plotHeight 99 this._plotDimensions = { height: null, width: null }
100
101 $.extend(true, this, options)
Found unused expression
50 // angle of text, measured clockwise from x axis.
51 this.angle = 0
52 // name of the axis associated with this tick
53 this.axis 54 // prop: show
55 // whether or not to show the tick (mark and label).
56 this.show = true
Found unused expression
94
95 this._elem
96 this._ctx
97 this._plotWidth 98 this._plotHeight
99 this._plotDimensions = { height: null, width: null }
100
Found unused expression
92 // 3.5 and Safari 4 since they do not provide a method to determine the font height.
93 this.pt2px = null
94
95 this._elem 96 this._ctx
97 this._plotWidth
98 this._plotHeight
Found unused expression
93 this.pt2px = null
94
95 this._elem
96 this._ctx 97 this._plotWidth
98 this._plotHeight
99 this._plotDimensions = { height: null, width: null }
Found unused expression
450 }
451 points = []
452 base = gridData[i][1] - this._barNudge
453 xstart454
455 if (this._stack && this._prevGridData.length) {
456 xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x')
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