Imagine that you have a class with a member variable
private var radius:Number;
And then inside a method you create a local variable with this same name
private function func():void{
var radius:Number = 5;
}
Can I make the Flex compiler warn me about this situation? That I may actually want to use the member variable instead of this local variable I’ve just defined?
EDIT: I guess the flex compiler can’t do that. Would be hard to make a as3 lint tool do that? I mean, I would code that.
FlexPMD already does that.
In FlashDevelop it’s called “Analyze Project Source Code”, the problem is, it have so many false alarms, or warning that are not really important that this problem may go unnoticed.
You can customize this ruleset by editing the file default-ruleset.xml (or you can create other one and set it on Program Settings -> Code Analyzer) located in Program Files/FlashDevelop/Tools/flexpmd.
Also, to make things easier you can create a shortcut in Tools -> Keyboard Shortcuts -> FlashToolsMenu.AnalyzeProject