Safety in Osaka
Osaka has a dangerous reputation (by Japanese standards), but is still remarkably safe for a city of its size, and the overall level of crime is as low as in Tokyo or other Japanese cities. However, some areas, particularly Shinsekai and Tobita, may be a little dodgy at night and the Airin/Kamagasaki area — Japan's largest slum, home to a lot of jobless and/or homeless people — south of Shin-Imamiya is best avoided at most times, especially after dark.
Incidentally, despite the movie stereotype of gangsters speaking in Osakan dialect, the actual base of Japan's biggest yakuza families is neighboring Kobe — and the most gang violence occurs in Tokyo. Unless you're dealing drugs, you're unlikely to get involved with the local mafia.