A variable is considered unused in the following cases: The inspection is disabled for global space by default. To change the behaviour check the option "Enable inspection in global space".