Madera is a pretty safe city. I actually live here with my family and it's very peaceful. There are good and bad pockets in this area though. Schnoor Area of Madera is probably the ideal place to live if you want to live in Madera. Madera has a plethora of gated communities and the price of a large 4 bedroom and 5 bedroom homes are really cheap compared to Santa Clara, San Mateo, and San Francisco Counties.
I own homes in both San Francisco (Bernal Heights) and Madera. This is a country town with nice people and peaceful living.
Hope this helps!
Jonah Marc Properties