I haven't been to Barcelona in something approaching 10 years and I only spent a week there when I did. I had an amazing time and it was one of the most exciting cities I've ever visited.
That said, the amount of criminality on show to your average tourist was surprising. Offers of drugs and being accosted by prostitutes in the street was common place, not to mention lower level crime like graffiti and people selling beers on the street.
I think someone would be forgiven for coming away with the wrong impression of it as a city.