I am looking for a trick to find included files that are not in use. Preferrably not by going trough them by hand. This project has over 400 of such files, 100 are probably unused by now.
They are Drupal template files (tpl.php) and were placed in the theme/template during development and -as always- were never removed when obsoleted.
Things I have thought of: * maintain a register in the database or a log, and spider the site. All files that don't appear in the log are candidates for removal, and need manual checking. * use a file-profiling tool such as cachegrind to render call-stacks: the files should appear in there somehow. I have no idea, however, how to get this done.
Problem in Drupal templates, is that they are very dynamic, so simply grepping for include_once() and the likes does not work.
How do you avoid template-lint in Drupal?