As a young woman living in a dangerous area, I have to say this is not only offensive, it’s bad advice.
The neighborhood that I live in is pretty rough, so I have some knowledge from which to speak.
Criminals are opportunists. It doesn’t matter who you are or how you dress; if you look like you might have something worth taking and/or you won’t give too much trouble, you may be looked at as a target. (By way of illustration, a couple months ago in my neighborhood, a group of priests and a nun were assaulted and robbed as they walked back to their lodgings from a local restaurant; criminals around here make no distinctions.)
For me, abiding by the standards of “modesty” quoted above would be extremely unwise.
I occasionally have to walk to/from the train station by myself after dark; it’s not very safe, but it’s unavoidable and will get more unavoidable as the days get shorter. If you are a woman walking alone in a situation like this you would be wise to wear clothes that you feel comfortable running and or fighting in (police safety tips will back me up on this) and that don’t have hanging bits that an attacker can use to hold you back or drag you. This does not include most skirts. You will only catch me out after dark wearing slacks/jeans and sneakers or “stout” (as the Brits say) shoes – for my own safety.