Checking whether function declarations reach the end without an explicit return