The former WA Supreme Court judge Michael Murray has attacked mandatory sentencing, saying it is not a deterrent to criminals and often leads to injustice.
The State Government says it will extend mandatory jail terms to include offenders convicted of violent home invasions, if it wins the state election.
Such laws already exist for people who cause bodily harm to police and other public officers.
Justice Murray, who served on the Supreme Court for 22 years, says each crime is complex and judges must have discretion to set jail terms accordingly.
"Any sentencing exercise involves mixing a very complicated web of relevant factors concerned with the seriousness of the crime and the nature of the offender," he said.
"The need to impose the mandatory punishment simply creates injustice that otherwise would have been avoided by exercising discretion."
Justice Murray says there are better ways to reduce violent crime than mandatory sentencing.
"They are much more likely to be deterred by the severity of punishment being commensurate with the seriousness of the crime," he said.
"And, understanding that A, they are likely to be apprehended and processed in the criminal justice system and B, they are likely to receive significant punishment once that happens."
The Police Minister Liza Harvey has defended the State Government's mandatory sentencing laws, saying they have led to a drop in crime.
Mrs Harvey says the community likes mandatory sentencing because it works.
"The evidence that I have shows me that after we introduced mandatory sentencing for people who assault police officers, there was an immediate reduction of 26 to 28 per cent in the number of assaults against police officers," she said.
"So it works, it does act as a deterrent."
Justice Murray is the new parliamentary inspector for WA's Corruption and Crime Commission.