
Unreachable scripts can be safely removed without affecting your project.

Unreachable code can clutter your project. Note that our analysis disregards the fragment scripts not beginning with event blocks, as they are commonly used by Scratch programmers to experiment with code and to initialize persistent data. This particular case is often caused by removing only the broadcast blocks without adjusting their corresponding receiver blocks. Other Code Smells Unreachable CodeĪ script is considered unreachable if it is the receiver of a nonexistent message. Non-meaninful names for sprites and variables make your code hard to understand. Don’t repeat yourself Long ScriptĪ script is considered too long ( > 11 blocks) vertically.Īn unreasonably long script can suggest inadequate decomposition and hinder code readability. Duplicate CodeĪ fragment of code is duplicated as a way to reuse existing functionality of code at multiple locations within the same Sprite. Too many global variables can also be confusing for programmers trying to find the right variable in the script palette and the drop-down menus. Proper variable scope helps improve comprehensibility as it tells to which sprite the variable belongs. By following commonly accepted design practices, variables should be made local to the scope that uses it.


Blockly is a JavaScript library that allows developers to add a visual code editor to websites and mobile apps.
