Poorly generally. I can't comment on Ninjas but the samurai have been mythologized.
Firstly; the idea of Samurai honor has been over exaggerated. It is true there were "do's and dont's" but they weren't as solid as people make them out to be. Bushido is what people are usually referring to when they talk about samurai honor. If you read the link you'll find out why that isn't so correct. Samurai also had a habit of switching sides in battle if things weren't going their way.
Secondly, the katana wasn't their main weapon. Samurai, like all warriors, had many different weapons from the yari spear, to bows, and even guns. In fact, one of the unifiers of Japan, Oda Nobunaga, was quite famous for bow and gun volleys. Samurai certainly would have carried swords but for most practical purposes on a battlefield they were likely're better as backup weapons.
I'd answer other misconceptions but you'll need to specify them.