Personally public transport in Barcelona felt safer than the equivalent in most major North American cities. For example there’s what I believe is a bullet hole in the glass at one of the stations I frequently use — and I know for a fact that several people have been shot dead directly outside that station.
They got me once and I've busted them trying a couple of times. Whenever you grab them they always just drop the phone or wallet and walk off, they never fight. But I did notice they always work in groups so they probably do attack if you get violent yourself.
It feels less safe than London, I have lived in 3 not so good boroughs in London.
Barcelona is really not bad at all for violent crime :)
There's some places that really are a bit unsafe but it's more out. Like La Mina, there's been some shootings there recently: https://www.lavanguardia.com/sucesos/20210908/7706383/tirote... (Though technically that's not Barcelona anymore but Sant Adria de Besos)
As far as the general sense of unease goes, Barcelona takes the first place. Some people there are outright creepy. I generally like the city, but I would not dare venture into the old centre's small alleys after dark.
Also, pickpockets. All touristy places have them, but Barcelona, man...
Shame, because the city is otherwise a jewel.
Btw , I fully agree that the particular rambla de Raval Is tacky, overpriced and the food is just bad. The places on the beach are much better. Ah, now thinking about it, kinda miss the city, it has many good parts and things.
A friend of mine works there as security and after all the stories he told me I rather get in a car and deal with the traffic.
And I'm saying this as someone who uses the subway to commute but in a safer city. I literally get in, close my eyes and open them after 20 minutes.