SAN FRANCISCO — A federal judge tossed a securities class action on Thursday that slammed Hewlett-Packard Co. for touting its code of conduct even as its former CEO became embroiled in an ethics scandal. U.S. District Judge Jon Tigar granted HP’s motion to dismiss a putative class action that reached back to the fall of former HP CEO Mark Hurd, who resigned in 2010 after a contractor claimed that he made inappropriate sexual advances toward her. Plaintiffs alleged that HP misled investors by adopting a new ethics code without disclosing Hurd’s missteps.

But Tigar ruled in a 14-page order that plaintiffs had failed to show the Standards of Business of Conduct HP issued in 2008 contained false statements that investors might have relied on. He also rejected plaintiffs’ argument that Hurd’s adoption of the code suggested that he abided by it.