While there are obviously crime stats that give crime rates for whatever somewhat arbitrary political boundary defines a city, they can tell a misleading story. LA covers a
lot of different types of areas. SF does to some degree as well (and a lot of visitors are most familiar with area around the Moscone which is at least near somewhat sketchy areas).
But this is really true in general. I consider Boston a pretty safe city. But there are absolutely areas that I wouldn't be walking around late at night.