[js] fix wanrings and errors found by code quality checkers#22695
Conversation
Several useless break and if statements In the elements loop - when element removed one need to decrease index to continue with next element Duplicated 'tooltip' property
Useless if statement Wrong check for function type
Useless if statement Duplicated 'tooltip' property
Several fixes found by static checker
| const b = d.get('batch'); | ||
| if (b !== undefined) { | ||
| setBatchMode(d !== 'off'); | ||
| setBatchMode(b !== 'off'); |
There was a problem hiding this comment.
A good way to avoid such bugs is having better names for variables...consider renaming them
There was a problem hiding this comment.
There are too many of such places. Start changing them - one can introduce more errors
There was a problem hiding this comment.
I didn't propose to change all places at the same time, just the ones we discover over time such as this. I see no chance of introducing more errors if it's just a local variable renaming.
There was a problem hiding this comment.
"Resolving" an ongoing conversation and merging regardless is not a great practice...
There was a problem hiding this comment.
JavaScript code changed not here - but in JSROOT repository.
Your are welcome to provide PR there.
But I see no big advantage to change variable names in existing code.
Test Results 22 files 22 suites 3d 15h 0m 55s ⏱️ For more details on these failures, see this check. Results for commit 742f6da. |
Changes are in JSROOT and UI5 components
Most about useless if conditions or unused functions arguments
But also real bugs where instead
bvariabledwas used orwrong check of function name for function type.
Fixes split by components