Which code part in bitcoin-core project generates new bitcoin addresses?
See CWallet::GenerateNewKey in src/wallet.cpp.  It calls either DeriveNewChildKey or MakeNewKey depending on whether HD wallets are in use.