A zen master once said “Thinking ‘I want to punch you in the nose’ creates the same karma as punching the person in the nose.”
That zen master was wrong.
Why? Because karma is the law of cause and effect. A thought is not a cause and therefore does not have an effect. What is a cause? Making a choice is a cause that creates an effect.
So, choosing to feed the thought “I want to punch you in the nose” creates karma. Choosing to see that thought and let it go creates different karma. It is our choice of how to deal with the thought that creates the karma, not the thought itself.
So quit judging yourself for having yukky thoughts. Please.