|
| 1 | +// Empty functions that don't do anything |
| 2 | +function doNothing1() { |
| 3 | + // Not implemented |
| 4 | +} |
| 5 | + |
| 6 | +function doNothing2() { |
| 7 | + // No logic here |
| 8 | +} |
| 9 | + |
| 10 | +function unusedFunction1() { |
| 11 | + // Intentionally left empty |
| 12 | +} |
| 13 | + |
| 14 | +function unusedFunction2() { |
| 15 | + // Another empty function |
| 16 | +} |
| 17 | + |
| 18 | +// Unused variables |
| 19 | +const unusedVariable1 = "This is never used"; |
| 20 | +const unusedVariable2 = 42; |
| 21 | +let unusedVariable3; |
| 22 | + |
| 23 | +// Empty class with no methods |
| 24 | +class UnusedClass { |
| 25 | + constructor() { |
| 26 | + // Constructor does nothing |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +// Empty object literal |
| 31 | +const emptyObject = {}; |
| 32 | + |
| 33 | +// Empty array |
| 34 | +const emptyArray = []; |
| 35 | + |
| 36 | +// Function with parameters but no body |
| 37 | +function doNothingWithParams(param1, param2) { |
| 38 | + // No implementation |
| 39 | +} |
| 40 | + |
| 41 | +// Function that returns nothing |
| 42 | +function returnsNothing() { |
| 43 | + // No return statement |
| 44 | +} |
| 45 | + |
| 46 | +// Another unused function |
| 47 | +function unusedFunction3() { |
| 48 | + // More empty code |
| 49 | +} |
| 50 | + |
| 51 | +// Empty functions with different signatures |
| 52 | +function doNothing4() { |
| 53 | + // No logic here |
| 54 | +} |
| 55 | + |
| 56 | +function doNothing5() { |
| 57 | + // Another placeholder |
| 58 | +} |
| 59 | + |
| 60 | +function doNothingWithRestParams(...args) { |
| 61 | + // Function with rest parameters but no logic |
| 62 | +} |
| 63 | + |
| 64 | +function doNothingWithCallback(callback) { |
| 65 | + // Callback not called |
| 66 | +} |
| 67 | + |
| 68 | +// Unused variables of different types |
| 69 | +const unusedVariable7 = null; |
| 70 | +const unusedVariable8 = undefined; |
| 71 | +const unusedVariable9 = Symbol('unused'); |
| 72 | +let unusedVariable10; |
| 73 | + |
| 74 | +// Another empty class |
| 75 | +class YetAnotherUnusedClass { |
| 76 | + // No properties or methods |
| 77 | +} |
| 78 | + |
| 79 | +// Unused object with nested array |
| 80 | +const unusedObjectWithArray = { |
| 81 | + innerArray: [] |
| 82 | +}; |
| 83 | + |
| 84 | +// Another empty array |
| 85 | +const anotherEmptyArray = []; |
| 86 | + |
| 87 | +// Function with default and rest parameters |
| 88 | +function anotherComplexFunction(param1 = 10, ...rest) { |
| 89 | + // No implementation |
| 90 | +} |
| 91 | + |
| 92 | +// More unused functions |
| 93 | +function unusedFunction5() { |
| 94 | + // Placeholder |
| 95 | +} |
| 96 | + |
| 97 | +function unusedFunction6() { |
| 98 | + // Empty again |
| 99 | +} |
| 100 | + |
| 101 | +function unusedFunction7() { |
| 102 | + // Still nothing here |
| 103 | +} |
| 104 | + |
| 105 | +// Empty static method in class |
| 106 | +class UnusedClassWithStaticMethod { |
| 107 | + static unusedStaticMethod() { |
| 108 | + // No logic inside static method |
| 109 | + } |
| 110 | +} |
| 111 | + |
| 112 | +// Empty getter and setter in a class |
| 113 | +class ClassWithGetterSetter { |
| 114 | + get unusedGetter() { |
| 115 | + // Empty getter |
| 116 | + } |
| 117 | + |
| 118 | + set unusedSetter(value) { |
| 119 | + // Empty setter |
| 120 | + } |
| 121 | +} |
| 122 | + |
| 123 | +// Unused function returning undefined |
| 124 | +function returnsUndefined() { |
| 125 | + return undefined; |
| 126 | +} |
| 127 | + |
| 128 | +// Empty promise-returning function |
| 129 | +function emptyPromiseFunction() { |
| 130 | + return new Promise((resolve, reject) => { |
| 131 | + // No promise logic |
| 132 | + }); |
| 133 | +} |
| 134 | + |
| 135 | +// Empty immediately-invoked function expression (IIFE) |
| 136 | +(function emptyIIFE() { |
| 137 | + // No implementation |
| 138 | +})(); |
| 139 | + |
| 140 | +// Unused generator function with parameters |
| 141 | +function* unusedGeneratorFunctionWithParams(param1, param2) { |
| 142 | + // No yielding of values |
| 143 | +} |
| 144 | + |
| 145 | +// Unused async arrow function |
| 146 | +const unusedAsyncArrowFunction = async () => { |
| 147 | + // No async logic here |
| 148 | +}; |
| 149 | + |
| 150 | +// Unused map function with no logic |
| 151 | +const unusedMapFunction = new Map(); |
| 152 | + |
| 153 | +// Unused set function with no logic |
| 154 | +const unusedSetFunction = new Set(); |
| 155 | + |
| 156 | +// Empty for loop |
| 157 | +for (let i = 0; i < 10; i++) { |
| 158 | + // Loop does nothing |
| 159 | +} |
| 160 | + |
| 161 | +// Empty while loop |
| 162 | +while (false) { |
| 163 | + // Never executes |
| 164 | +} |
| 165 | + |
| 166 | +// Empty try-catch-finally block |
| 167 | +try { |
| 168 | + // Nothing to try |
| 169 | +} catch (error) { |
| 170 | + // No error handling |
| 171 | +} finally { |
| 172 | + // Nothing to finalize |
| 173 | +} |
| 174 | + |
| 175 | +// Empty if-else block |
| 176 | +if (false) { |
| 177 | + // No logic here |
| 178 | +} else { |
| 179 | + // Nothing here either |
| 180 | +} |
| 181 | + |
| 182 | +// Empty switch statement |
| 183 | +switch (false) { |
| 184 | + case true: |
| 185 | + // No case logic |
| 186 | + break; |
| 187 | + default: |
| 188 | + // Default does nothing |
| 189 | + break; |
| 190 | +} |
| 191 | + |
| 192 | +// Empty nested function |
| 193 | +function outerFunction() { |
| 194 | + function innerFunction() { |
| 195 | + // Empty inner function |
| 196 | + } |
| 197 | +} |
| 198 | + |
| 199 | +// More unused arrow functions |
| 200 | +const unusedArrowFunction1 = () => {}; |
| 201 | +const unusedArrowFunction2 = param => {}; |
| 202 | + |
| 203 | +// Empty function with a try-catch block |
| 204 | +function emptyTryCatchFunction() { |
| 205 | + try { |
| 206 | + // Nothing to try |
| 207 | + } catch (error) { |
| 208 | + // No error handling |
| 209 | + } |
| 210 | +} |
| 211 | + |
| 212 | +// Unused async generator function |
| 213 | +async function* unusedAsyncGenerator() { |
| 214 | + // No async yielding |
| 215 | +} |
| 216 | + |
| 217 | +// Unused function returning an empty array |
| 218 | +function returnsEmptyArray() { |
| 219 | + return []; |
| 220 | +} |
| 221 | + |
| 222 | +// Unused function returning an empty object |
| 223 | +function returnsEmptyObject() { |
| 224 | + return {}; |
| 225 | +} |
0 commit comments