Welcome to the Community and thank you for brining this up!
I agree with you, function definitions shouldn’t increase the Cognitive Complexity of their parents.
Although there might be some cognitive overhead if the child function uses parent’s variables (closure).
We have fixed some aspects of this in the past for React, like ticket #2238.
But we need to do more, like in the case you bring up.
We have a ticket that partially covers this #3289, which you can follow to get updates.