Always ask to see code and talk to engineers about what their days look like. I believe there are very few legitimate reasons they won't show you their code, but more likely if they're refusing, it's because they're hiding something. When talking to an engineer, ask them how their code goes from idea to production and have it explained in detail. This will tell you what type of management they have, what testing/review/deployment practices, etc.. As a bonus, I also like to ask my future peers what they don't like about their job or what they'd like to change.
I agree most jobs are some form of shite, but there are good ones. Being more picky during the interview phase should hopefully allow you to find some of those while weeding out the bad quicker.