Splitting refers to a defence mechanism in which someone who can't cope with ambivalent feelings about others compartmentalizes those people as all good or all bad.
Other /More definition:
Splitting refers to a defense, common in people with Borderline personality disorder, in which individuals perceive others, or themselves, as being all good or all bad, usually resulting in disturbed interpersonal relationships.