San Bernardino was ranked as America’s third-most dangerous city while Irvine was scored as California’s safest, according to a new yardstick by WalletHub.

The financial-services website took a wider study of safety than the frequently cited FBI crime statistics to weigh “where Americans can feel most secure — in more than one sense.” It analyzed 183 big cities for 41 types of crimes, demographics, climate and economic factors to gauge safety in three key traits: home and community safety, natural-disaster risk and financial safety.

Only two cities — St. Louis and Fort Lauderdale — fare worse than San Bernardino by this security yardstick. The city ranked third-lowest for community safety, No. 160 for disaster risk and No. 161 for financial risk. And, of course, it was California’s most-dangerous town among the 29 cities tracked.

Irvine, No. 29 nationally, was California’s highest-scored city. It ranked fourth-best for community safety but No. 150 of 183 for disaster risk and No. 105 for financial risk. Columbia, Md., was No. 1 for overall safety.

Here’s how other Southern California cities fared on this 183-city scoreboard: national ranking; category rankings; and statewide stand.

No. 49 Rancho Cucamonga: No. 9 for community safety; No. 159 for disaster risk; and No. 91 for financial risk. State rank? No. 4.

No. 52 Glendale: No. 6 for community safety; No. 151 for disaster risk; and No. 133 for financial risk. State rank? No. 5.

No. 54 Huntington Beach: No. 10 for community safety; No. 170 for disaster risk; and No. 94 for financial risk. State rank? No. 6.

No. 79 Ontario: No. 36 for community safety; No. 156 for disaster risk; and No. 117 for financial risk. State rank? No. 10.

No. 87 Santa Clarita: No. 14 for community safety; No. 168 for disaster risk; and No. 172 for financial risk. State rank? No. 12.

No. 88 Moreno Valley: No. 37 for community safety; No. 166 for disaster risk; and No. 137 for financial risk. State rank? No. 13.

No. 89 Fontana: No. 47 for community safety; No. 163 for disaster risk; and No. 121 for financial risk. State rank? No. 14.

No. 92 Garden Grove: No. 50 for community safety; No. 171 for disaster risk; and No. 108 for financial risk. State rank? No. 15.

No. 101 Anaheim: No. 59 for community safety; No. 154 for disaster risk; and No. 126 for financial risk. State rank? No. 18.

Are you a real estate fan? Then sign up for The Home Stretch newsletter and its Bubble Watch edition A twice-a-week review of what’s important for housing around the region! Subscribe here!

No. 109 Santa Ana: No. 57 for community safety; No. 167 for disaster risk; and No. 142 for financial risk. State rank? No. 19.

No. 116 Riverside: No. 81 for community safety; No. 164 for disaster risk; and No. 112 for financial risk. State rank? No. 20.

No. 129 Long Beach: No. 85 for community safety; No. 152 for disaster risk; and No. 149 for financial risk. State rank? No. 23.

No. 171 Los Angeles: No. 161 for community safety; No. 149 for disaster risk; and No. 159 for financial risk. State rank? No. 28.