I am redoing my cabinets. I had a soffit when when I opened it up to remove I have 3-4 cables running through it. My question is if I do not have enough slack to get it over the joists or I can’t notch the hoist and add a nail plate. Can I cut the line and add two junction boxes to lengthen the romex line? Would this be up to code? I would have it accessible above the cabinets?
All junction boxes need to be accessible.
Don't mess with that rule, it's a very important one.
If the junction boxes meet or exceed the size required for "box fill" (there are calculators on the web, if the one you stumble on at first is not to your liking, choose another, many work fine/easily, or you can read the tables and do the calcs by hand if you like) and are accessible, extending cables that way is code compliant.
Obligatory opinionated advice to use steel boxes rather than the blue plastic junque.