A former Massachusetts chemist was high on drugs almost every day for the nearly eight years she worked at an Amherst drug lab, according to an investigation released by the state attorney general.

Investigators found that Sonja Farak tested drug samples and testified in court while under the influence of methamphetamines, ketamine, cocaine, LSD and other drugs between 2005 and 2013, according to court documents released Tuesday.

A spokeswoman for Attorney General Maura Healey said the information gathered about Farak "will no doubt have implications for many cases."

One defense attorney told the Boston Herald that Farak handled about 30,000 cases over the course of her career.

"This is a statewide scandal and I think it's going to take an enormous toll on the system," attorney Luke Ryan said.

Many of the shocking details came from Farak's own grand jury testimony, including that she once smoked crack before a 2012 state police accreditation inspection of the now-closed lab.

Farak pleaded guilty to tampering with evidence, stealing cocaine from the lab and unlawful possession in January 2014 and was sentenced to 18 months behind bars and five years of probation.

The attorney who represented Farak during her criminal case did not immediately respond to a telephone message from The Associated Press on Wednesday.

Farak's case was unrelated to the case of Annie Dookhan, who worked at a state drug lab in Boston. Dookhan was sentenced in November 2013 to at least three years in prison after pleading guilty to faking test results in criminal cases that jeopardized thousands of convictions. She has since been paroled. She worked at the lab for nine years until her suspension in 2011.