move finunusedcode to a script

Change-Id: Ie4a422a818095313d9765a4c5e9ebba838eed76d