A former chemist who tested drugs for Massachusetts police departments in thousands of court cases was high almost every day she went to work for eight years, investigators have said.

Sonja Farak, who worked for an Amherst laboratory which tested drug samples for police, was on methamphetamines, ketamine, cocaine, LSD and other drugs during most of her time there, even when she testified in court, according to a report.

Cyndi Roy Gonzalez, a spokeswoman for Attorney General Maura Healey, said the information on Farak “will no doubt have implications for many cases”.

She said: “We are deeply concerned whenever the integrity of the justice system is called into question or compromised.”

Annie Dookhan, a former chemist at the Hinton State Laboratory Institute, listens to the judge during her arraignment at Brockton Superior Court in Brockton, Massachusetts

Annie Dookhan was jailed for three years in 2013 for faking test results

Defence lawyer Luke Ryan told the Boston Herald that Farak handled around 30,000 cases while working at the lab between 2005 and 2013.

He said: “This is a statewide scandal, and I think it’s going to take an enormous toll on the system.”

The American Civil Liberties Union of Massachusetts (ACLU) said the number of criminal cases affected by Farak’s misconduct could rival the approximately 40,000 cases thrown into question by the actions of Annie Dookhan, who worked at a state drug lab in Boston.

Dookhan was sentenced to at least three years in prison in 2013 after pleading guilty to faking test results in criminal cases which jeopardised thousands of convictions.

Matthew Segal, legal director of ACLU, said: “It’s now beyond doubt that the drug war in Massachusetts during the Dookhan-Farak era was built on a foundation of falsified evidence.”

He said that prosecutors who got convictions using drug samples tested by Farak “have an obligation to identify and notify everyone who might have been denied due process”.

Farak has admitted ingesting lab “standards” – drug samples used as benchmarks to test against substances submitted by police for testing.

Mr Segal said all cases that went through the lab should be re-examined.

Farak, 37, of Northampton, pleaded guilty to tampering with evidence, stealing cocaine from the lab and unlawful possession in January 2014 and was sentenced to 18 months in prison. She served her sentence and has been released.

During her own grand jury testimony, she admitted she once smoked crack before a 2012 state police accreditation inspection of the now-closed lab. She also testified that she manufactured crack cocaine for her personal use in the lab.

Governor Charlie Baker has said the state will have to allocate more money to deal with the Farak scandal.

He said: “We certainly believe we are going to have a big responsibility to work with the courts and with others to make sure that people who are affected by this have the appropriate opportunity to engage in that conversation.”