LordGolias/sqf

No warning for unused private variables

kymckay opened this issue · 2 comments

example.sqf:

private _var = 2;

comment "Do nothing";

The variable _var is totally pointless in this function as it is never used after initial assignment (admittedly the function itself is pointless) and can be removed at no penalty.

The only thing worth noting here is that if there is a call to an external piece of code (i.e. not in the same file) it is unknown whether the variable is then used in the lower scope.

To see if I understood, the goal here is to tell the developer of privates that are not being used.

Seems like a great new feature.

That's correct 👍 I also just thought of the case where there could be an '#include "something.sqf" which could cause false positives if the variable is used inside the included file