diff --git a/appengine/add_timestamps.py b/appengine/add_timestamps.py index af877f3d6..05ff7b928 100644 --- a/appengine/add_timestamps.py +++ b/appengine/add_timestamps.py @@ -62,8 +62,8 @@ def run_query(): while more: results, cursor, more = query.fetch_page(PAGE_SIZE, start_cursor=cursor) handle_results(results) - page_count = page_count + 1 - result_count = result_count + len(results) + page_count += 1 + result_count += len(results) print(f'{datetime.datetime.now().strftime("%I:%M:%S %p")} : page {page_count} : {result_count}') run_query() diff --git a/core/field_variable.ts b/core/field_variable.ts index 95474e4b1..539557256 100644 --- a/core/field_variable.ts +++ b/core/field_variable.ts @@ -444,7 +444,6 @@ export class FieldVariable extends FieldDropdown { // #1499. // Set the allowable variable types. Null means all types on the workspace. if (Array.isArray(variableTypes)) { - variableTypes = variableTypes; // Make sure the default type is valid. let isInArray = false; for (let i = 0; i < variableTypes.length; i++) { diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 07c909ccf..871060196 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -75,8 +75,7 @@ export function load( } // reverse() is destructive, so we have to re-reverse to correct the order. - for (let [name, deserializer] of deserializers.reverse()) { - name = name; + for (const [name, deserializer] of deserializers.reverse()) { const pluginState = state[name]; if (pluginState) { (deserializer as ISerializer)?.load(state[name], workspace); diff --git a/core/shortcut_registry.ts b/core/shortcut_registry.ts index 35f409b48..161a2ed14 100644 --- a/core/shortcut_registry.ts +++ b/core/shortcut_registry.ts @@ -287,7 +287,7 @@ export class ShortcutRegistry { } } if (serializedKey !== '' && e.keyCode) { - serializedKey = serializedKey + '+' + e.keyCode; + serializedKey += '+' + e.keyCode; } else if (e.keyCode) { serializedKey = String(e.keyCode); } @@ -335,7 +335,7 @@ export class ShortcutRegistry { } if (serializedKey !== '' && keyCode) { - serializedKey = serializedKey + '+' + keyCode; + serializedKey += '+' + keyCode; } else if (keyCode) { serializedKey = `${keyCode}`; } diff --git a/core/utils/svg_math.ts b/core/utils/svg_math.ts index 88d38f625..0444787ad 100644 --- a/core/utils/svg_math.ts +++ b/core/utils/svg_math.ts @@ -87,8 +87,8 @@ export function getInjectionDivXY(element: Element): Coordinate { let y = 0; while (element) { const xy = getRelativeXY(element); - x = x + xy.x; - y = y + xy.y; + x += xy.x; + y += xy.y; const classes = element.getAttribute('class') || ''; if ((' ' + classes + ' ').includes(' injectionDiv ')) { break; diff --git a/generators/javascript/math.ts b/generators/javascript/math.ts index e8ab2852f..238ad19a2 100644 --- a/generators/javascript/math.ts +++ b/generators/javascript/math.ts @@ -318,7 +318,7 @@ function ${generator.FUNCTION_NAME_PLACEHOLDER_}(values) { } for (var j = 0; j < counts.length; j++) { if (counts[j][1] === maxCount) { - modes.push(counts[j][0]); + modes.push(counts[j][0]); } } return modes; @@ -341,7 +341,7 @@ function ${generator.FUNCTION_NAME_PLACEHOLDER_}(numbers) { for (var j = 0; j < n; j++) { variance += Math.pow(numbers[j] - mean, 2); } - variance = variance / n; + variance /= n; return Math.sqrt(variance); } `, diff --git a/scripts/i18n/js_to_json.py b/scripts/i18n/js_to_json.py index c070f3408..53651935e 100755 --- a/scripts/i18n/js_to_json.py +++ b/scripts/i18n/js_to_json.py @@ -81,7 +81,7 @@ def main(): for line in infile: if line.startswith('///'): if description: - description = description + ' ' + line[3:].strip() + description += ' ' + line[3:].strip() else: description = line[3:].strip() else: diff --git a/tests/generators/golden/generated.js b/tests/generators/golden/generated.js index f8ac5651a..ec103f0ba 100644 --- a/tests/generators/golden/generated.js +++ b/tests/generators/golden/generated.js @@ -513,7 +513,7 @@ function mathModes(values) { } for (var j = 0; j < counts.length; j++) { if (counts[j][1] === maxCount) { - modes.push(counts[j][0]); + modes.push(counts[j][0]); } } return modes; @@ -527,7 +527,7 @@ function mathStandardDeviation(numbers) { for (var j = 0; j < n; j++) { variance += Math.pow(numbers[j] - mean, 2); } - variance = variance / n; + variance /= n; return Math.sqrt(variance); } diff --git a/tests/generators/unittest_dart.js b/tests/generators/unittest_dart.js index 312a8fcc2..89f355389 100644 --- a/tests/generators/unittest_dart.js +++ b/tests/generators/unittest_dart.js @@ -154,7 +154,7 @@ dartGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, dartGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, dartGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_javascript.js b/tests/generators/unittest_javascript.js index 279244eb2..77953a37a 100644 --- a/tests/generators/unittest_javascript.js +++ b/tests/generators/unittest_javascript.js @@ -158,7 +158,7 @@ javascriptGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, javascriptGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, javascriptGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_php.js b/tests/generators/unittest_php.js index 408960d82..aedd7e6a1 100644 --- a/tests/generators/unittest_php.js +++ b/tests/generators/unittest_php.js @@ -145,7 +145,7 @@ phpGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, phpGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, phpGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_python.js b/tests/generators/unittest_python.js index ba29015f9..49f8c9100 100644 --- a/tests/generators/unittest_python.js +++ b/tests/generators/unittest_python.js @@ -129,7 +129,7 @@ pythonGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, pythonGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, pythonGenerator.ORDER_ATOMIC];