  It's well known that the quadratic residue code over finite fields is an
interesting class of cyclic codes for its higher minimum distance. Let $g$ be a
positive integer and $p,p_{1},\ldots, p_{g}$ be distinct odd primes, the
present paper generalizes the constructions for the quadratic residue code with
length $p$ to be the length $n=p_{1}\cdots p_{g}$, and to be the case $m$-th
residue codes with length $p$ over finite fields, where $m\geq 2$ is a positive
integer. Furthermore, a criterion for that these codes are self-orthogonal or
complementary dual is obtained, and then the corresponding counting formula are
given. In particular, the minimum distance of all 24 quaternary quadratic
residue codes $[15,8]$ are determined.
