kayler-renslow / arma-intellij-plugin

A plugin for Intellij IDEA that allows for syntactical analysis, code inspections, and other nifty features for the SQF scripting language in Arma 3.
MIT License
41 stars 10 forks source link

Add warnings for bad practices #66

Open dedmen opened 6 years ago

dedmen commented 6 years ago

Plugin Version

2.0.0

Summary

Add warnings for bad practices like using private ARRAY variant instead of the private keyword.

Detail

private ARRAY is evaluated at runtime and you also have to actually assign the variable after that. the private keyword is evaluated at compiletime and the variable assignment is directly integrated into it. The runtime/compiletime difference makes the private theoretically infinitely faster.

Also things like _coef = _x * _y * _x * (call complicatedMathFunction) * 15 * (32-16*2) * (damage player) Should get shown a warning because that's most likely an error and it's kinda hard to spot for a human.

Also completly idiotic things like using call compile "varname" or call compile format ["%1",varname] to read a variable, should get a visible warning.

Also needs a way to specifically ignore some warnings.