several code flaws in `app/assets/javascript/gl_dropdown.js`
Summary
There are several lines of code in app/assets/jaavscript/gl_dropdown.js
.
Those are unused (local) variables (Lines 72, 803, 961) and for/in
iterations of objects without checking for Object.hasOwnProperty
before performing actions on/with the object members (Lines 175, 180, 516, 520, 523 and 526).
Improvements
for/in
loops can potentially iterate over members from a custom/extended object (custom/inherited object members), so checking the instance with hasOwnProperty
eliminates the risk of performing unwanted actions.
Risks
there should not be any risks to the application.
Involved components
app/assets/jaavscript/gl_dropdown.js