Exactly. It would be very difficult to perform undercover operations in a uniform.Explain the dishonesty of not wearing uniforms and identifying themselves as required
There is no legal requirement for a police officer to wear a uniform. There is only a requirement for police to identify themselves as police when making an arrest ... there is no legal requirement for a police officer to give his name to someone he arrests.
There is also a silly but widely held false belief among criminal circles that undercover police must identify themselves if you ask them. I don't know when that rumor got started but I first heard it back in the '70s.
Perhaps the police themselves helped to spread that rumor?