Time Complexity of Recursive calls in for loop

How to calculate the time complexity when a recursive call is done under a loop.
For e.g:

In this case keypad1 is called under a for-loop.

Also, I was practicing a question i.e. Permutations where I faced a similar problem in calculating time complexity using tree diagram.