  For a perfect Lie algebra $\mathfrak{h}$ we classify all Lie algebras
containing $\mathfrak{h}$ as a subalgebra of codimension $1$. The automorphism
groups of such Lie algebras are fully determined as subgroups of the semidirect
product $\mathfrak{h} \ltimes (k^* \times {\rm Aut}_{\rm Lie} (\mathfrak{h}))$.
In the non-perfect case the classification of these Lie algebras is a difficult
task. Let $\mathfrak{l} (2n+1, k)$ be the Lie algebra with the bracket $[E_i,
G] = E_i$, $[G, F_i] = F_i$, for all $i = 1, \dots, n$. We explicitly describe
all Lie algebras containing $\mathfrak{l} (2n+1, k)$ as a subalgebra of
codimension $1$ by computing all possible bicrossed products $k \bowtie
\mathfrak{l} (2n+1, k)$. They are parameterized by a set of matrices ${\rm M}_n
(k)^4 \times k^{2n+2}$ which are explicitly determined. Several matched pair
deformations of $\mathfrak{l} (2n+1, k)$ are described in order to compute the
factorization index of some extensions of the type $k \subset k \bowtie
\mathfrak{l} (2n+1, k)$. We provide an example of such extension having an
infinite factorization index.
