intersystems / isc-codetidy

MIT License
2 stars 5 forks source link

Detect likely-unintended IF statements with multiple clauses, no parentheses #42

Open isc-tleavitt opened 11 months ago

isc-tleavitt commented 11 months ago

Reported internally within InterSystems:

It's a relatively common error to not include parenthesis in IF statements with multiple clauses. This almost always produces unexpected results.

I'd suggest two basic warnings:

|| - Any use of || where adjacent non-whitespace characters are not the appropriate parenthesis. && - Any use of && where adjacent non-whitespace characters are not the appropriate parenthesis.