Looks like an older insert installed into a zero clearance fireplace. Most likely this is not to code. It should be inspected to make sure that it's safe, cleaned and a liner is attached to the insert.
The odds are very strong that this installation is not up to code. If there are fire issues, this could be a problem with insurance. The other factor is how safely the insert was installed. The only way to tell this is with an inspection by a qualified professional that is looking for creosote accumulation, liner aging and stove connection, and any other safety issues.