Ugly porch light installation
Yes it’s ugly, I would cut some cedar 5/4 thick the with of that box and make a trim ring. Cedar won’t rot and is easy to work with a few finishing nails to hold the trim in place and it will look much better. Trim ring the size of the fixture not the box.
Actually this meets code if the correct wiring was used. The KO or 4x4 box up under the eve is a “dry” location and other than ugly because no trim was used to hide the box is the least expensive way to add a light.
To put the new light wiring in the walls/attic will normally cost much more.
Is this a gable porch?  any access to the house attic? Running this concealed will cost many times the surface mount and that is with good attic access.
2 story or poor access you can start adding zeros to the original cost for the extreme cases.
So I would recommend a trim piece that you can make for a few bucks possibly from wood scraps around the house, cedar can go un painted and left natural until time to repaint it will turn gray over time. This will be the least costly unless you want the wiring hidden bad enough to pay the premium it will cost to change the wiring from surface mount.