You can do this with a recursive walk over the AST. For example:
A sequence of statements returns on all control paths if either the first statement returns on all control paths or the second statement returns on all control paths.
An if statement returns on all control paths if both the "if" and "else" branches return on all control paths or the "if" statement is always true.
A while loop returns on all control paths only if the "while" condition is always true.
A return statement returns on all control paths.
Hope this helps!