Global Navigation Satellite System (GNSS) observations contain various errors, the separation and measurement of which is a popular research topic. Multipath effect on code measurements is investigated through the multipath combination, but carrier multipath error is small, and it is difficult to distinguish from other errors, such as hardware delay, carrier noise and satellite inherent biases. However, as the number of frequency points increases during the rapid development of GNSSs, it is possible to analyse the abovementioned errors in detail. Triple-frequency combination can be used to eliminate the first order ionospheric error, and a quad-frequency combination has one degree of freedom, which may be used to minimise carrier error effects. For this reason, an optimum method has been developed for multi-frequency GNSS code-multipath combination measurements, which has been verified by exploiting BeiDou System (BDS), three frequency data from an International GNSS Service (IGS) station and a city canyon as well as actual sampled quad-frequency data. By comparative analysis, we found that the fluctuations of an optimum triple-frequency combination are smaller than that of the non-optimum combination, which decreases the influence of inherent errors and biases on carrier phase. At the same time, second-order ionospheric error can be effectively eliminated as well. This provides a new code-multipath combination measurement optimisation methodology for future multi-frequency BDS and other GNSSs.