Yahoo CEO Marissa Mayer led a secret campaign to purge the company of male employees, according to a lawsuit filed in San Jose District Court this week.

Scott Ard, a media executive who worked for Yahoo for about three and a half years until he was fired in January 2015, alleged in the lawsuit that "Mayer encouraged and fostered the use of [an employee performance-rating system] to accommodate management's subjective biases and personal opinions, to the detriment of Yahoo's male employees."

Yahoo spokesperson Carolyn Clark told CNBC on Friday the lawsuit has no merit, saying, "fairness is a guiding principal of [the company's] annual review and reward process."

"With the unwavering support of our CEO we are focused on hiring employees with broad and varied backgrounds, and perspectives," she said. "As we have stated in the past, the quarterly performance review process is not only fair, but has improved our overall performance."

The complaint said quarterly performance reviews were implemented by Mayer in August 2012, shortly after becoming president and CEO of the company. Managers would assign each of their employees a quarterly rating on a scale of zero to five points, based on their performance.

The lawsuit argued that during a second step of the review process, called "calibration," higher-level management would modify employee ratings, despite having little to no actual contact with the employee. The suit further alleged that employees were never told their actual numeric rating, or how it had been determined.

Two other executives, Kathy Savitt, Yahoo's chief marketing officer at the time, and Megan Liberman, current editor-in-chief of Yahoo News (identified as vice president of news for Yahoo at the time), are mentioned in the lawsuit.

Ard alleged that 14 of the 16 senior-level editorial employees hired or promoted by Savitt in about an 18-month period were female. He also alleged Savitt has publicly expressed support for increasing the number of women in media and has intentionally hired and promoted women, while firing and demoting men because of their gender.

The suit also alleged that in November 2014, Liberman applied the review process and subsequently terminated another employee, Gregory Anderson, while he was on approved leave for the prestigious Knight-Wallace fellowship at the University of Michigan. Anderson reported directly to Ard at the time, but Liberman only allegedly shared her termination plan with him right before she carried it out.

Anderson filed a lawsuit against Yahoo in February 2016, alleging he was fired because of his gender. His attorney, Jon Parsons, declined to comment.

Parsons also represents Ard, making this the second case he has filed against Yahoo alleging anti-male discrimination.