Not the prettest box I've seen, but it seems to be installed in a way as to be flush with the ceiling.
As long as the box is mounted to something properly, I think it could be allowed.
As long as the box is mounted to something properly, I think it could be allowed.