From reading the International Residential Code, I assume this is not up to code. But what can be done to fix it? I'm more worried about the structural integrity of things.
Even if it's not to IBC and it's a load bearing wall, one compromised stud won't make the house fall down. You might get a little sag in the floor and roof above.
If you want to fix it, since the wall is open with the drywall removed, you could just sister another stud next to the damaged one. I see you'll have to notch it to accommodate the yellow electrical cable that goes through it. (Not to give you more headaches, but that doesn't look like it's compliant either...) Attach it to the existing stud with a few construction screws, it doesn't look like there's room to swing a hammer easily.