Open
Description
There is need for a new inspection for redundant function calls when guarding against divide-by-zero errors:
If Foo(Bar, Baz) > 0 then
Result = Frob(Baz) / Foo(Bar, Baz)
Else
Result = -1
End If
No big deal unless Foo()
is long running, memory intensive, network hogging, or...
Quick Fix would be:
Dim fooResult as Long
fooResult = Foo(Bar, Baz)
If fooResult > 0 then
Result = Frob(Baz) / fooResult
Else
Result = -1
End If
Giving the user the option to name fooResult
to his hearts desire.
There are probably other guard clause type situations (not just Div/0) that this would apply to, but a more general inspection is more difficult than what I can dream up at the moment.
Metadata
Metadata
Assignees
Labels
Involves simulating execution paths / interpreting the user code ..to an extent.Involves more challenging problems and/or developing within and revising the internals APIFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky