willowtreeapps / wist

A linter for BrightScript
Apache License 2.0
43 stars 11 forks source link

Add rule: limited "dot" chaining #98

Open cdthompson opened 6 years ago

cdthompson commented 6 years ago

At some point, chaining objects with the . operator becomes dangerous and prone to runtime errors due to an intermedia object being invalid.

It'd be nice to warn against some threshold of chained operations, such as:

if m.object.child.child.child.field = true
...
nishtahir commented 6 years ago

What should the threshold for chaining calls be?