Generally speaking, Shanghai is very safe. Violent crimes rarely happen and petty crimes are more common in comparison, though it's not that popular either. Scams, however, are a lot more prevalent.