  In this work, we study and determine the dimensions of Euclidean and
Hermitian hulls of two classical propagation rules, namely, the direct sum
construction and the $(\mathbf{u},\mathbf{u+v})$-construction. Some new
criteria for the resulting codes derived from these two propagation rules being
self-dual, self-orthogonal, or linear complementary dual (LCD) codes are given.
As an application, we construct some linear codes with prescribed hull
dimensions, many new binary, ternary Euclidean formally self-dual (FSD) LCD
codes, and quaternary Hermitian FSD LCD codes. Some new even-like, odd-like,
Euclidean and Hermitian self-orthogonal codes are also obtained. Many of
{these} codes are also (almost) optimal according to the Database maintained by
Markus Grassl. Our methods contribute positively to improve the lower bounds on
the minimum distance of known LCD codes.
