When asked to name the most dangerous place for crime in California, Compton, L.A.'s Eastside or the East Bay might come to mind.

You'd be wrong.

The most dangerous city in the Golden State when it comes to crime, police presence and other “community factors” such as poverty, the high school graduation rate and comparatively low police budgets, is in the Inland Empire.

It's San Bernardino.

That, at least, is according to the Southern California law firm of Graham Donath, which commissioned a report that crunches the numbers and gives us a list of California's most dangerous cities.

San Bernardino, a Great Recession–embattled town that's in bankruptcy, doesn't have the highest crime rate. Oakland and Stockton are worse when it comes to serious, violent crimes (murder, rape, robbery and assault), the analysis found.

But when all the factors were calculated, including unemployment, police per capita and even the number of days in a year when the high temperature was higher than 80 degrees, San Bernardino is your winner, the Donath report says.

The city, for example, ranked in the top 10 for municipalities with the lowest investment in law enforcement. It also ranked in the top 10 for those “community factors” we talked about.

All across this great state there's a lot to be desired when it comes to fixing lawlessness, however.

The analysis notes that all of its top-10 cities had a poverty rate of nearly 15 percent (14.5) or greater. That includes Los Angeles, where about one in five people (21.2 percent) lives in poverty, according to the report.

San Bernardino's poverty rate is pegged at a whopping 30.6 percent.

The analysis cites the high cost of living as a possible pressure point for crime. We don't need to tell you that housing costs in L.A. are out of control.

“One explanation for high poverty levels in California cities could be the rising cost of living with stagnant wages,” the report says. “The poverty has actually grown in the state since 2007, and this could be because the increased cost of living is sending people into debt. It’s also encouraging people to leave or discouraging them from moving to the state.”

Los Angeles, by the way, ranked 19th on the dangerous cities list.