Can you tell me what the code is around electrical boxes in homes with a basement?
This is an easy one, code requires the wiring to be protected below 8’ it can be in conduit (not a cost effective option here).

It can be protected by 1/2” plywood or Sheetrock ! Here is the East way to go. 

I would attach some 2x4’s on either side of the box to the floor Joist , then a simple piece of Sheetrock or plywood ~16” wide would meet code. The wiring run through the holes in the joist should be fine. But below 8’ on the walls they need to be protected.

An easy hint 
a 8’ 2x 4 cut in 4 pieces one laid flat on each sid of the box with 2 tap con screws to hold it in place then nail or screw the other 2 pieces on top of the 2 that are screwed to the wall next the piece of Sheetrock or ply wood to cover it all. A couple dollars for the 2x 4 tap con screws are a bit more expensive some come with the drill bit. 4 screws to hold the 2x4 to the 2x4’s and then 4 more screws to hold the Sheetrock to the 2x4’s,

It could be done with construction adhesive instead of screws but I don’t recommend this but it could be done , I lived in Dayton and did enclose my panel (using construction adhesive in my youth) I had gone through apprenticeship prior to that time and it passed. Today I try to make it serviceable where construction adhesive really requires it to be torn out to pull new circuits.

Added code references: 334.10  must be permitted by to be used except where prohibited by 334.12

334.15 .B exposed work. Protected from damage Cable shall be be protected where necessary 

334.15.C installed on the wall of a basement shall be allowed to be installed in conduit or tubing or protected in accordance with 300.4

So yes nm cables on a basement wall require protection. In this case the easiest way is to “finish that section” and box it in.