Any candidate at a primary election may contest the right of another candidate to nomination to the same office by filing an affidavit alleging any of the following grounds, that:
(a)
The defendant is not eligible to the office in dispute.
(b)
The defendant has committed any offense against the elective franchise defined in Division 18 (commencing with Section 18000).
(c)
A sufficient number of votes were illegal, fraudulent, forged, or otherwise improper, and that had those votes not been counted, the defendant would not have received as many votes as the contestant.
(d)
A sufficient number of eligible voters who attempted to vote in accordance with the laws of the state were denied their right to vote, and that had those voters been permitted to vote, the defendant would not have received as many votes as the contestant.
(e)
Due to mistake, error, or misconduct the votes in any precinct were so incorrectly counted as to change the result.