I'm pretty sure there's no official name for it, and it's not bipolarity. If someone has that kind of humor, though, maybe something happened to them during their childhood.
It's likely that she's been through some pretty tough and frustrating times. This could be child abuse, however I don't know the entire background story, so I won't automatically assume it is. It could be a good explanation for this, though.
Constant child abuse will lead to severe problems for the victims in the future. This may range from anti-sociality to certain diseases that may occur. Stress/anxiety plays a MAJOR role here, as all these problems are derived from the silent killer known as stress.
Again, I won't automatically assume she's been a victim of child abuse or anything of the like, because I don't know the entire story of her childhood. But I'd still suggest talking to her and asking her what's up - maybe she'll open up!