Can I find errors without using testing data for all the branches of each function?
Well, there is the Postgres extension plpgsql_check, successor of plpgsql_lint:


  plpgsql_check is next generation of plpgsql_lint. It allows to check
  source code by explicit call plpgsql_check_function.


I'm not currently using either, but the author Pavel Stehule is one of the core developers of PL/pgSQL (and also active around here).

Pavel announced it Dec. 2013 in this blog post.