-5
My code is displaying the following message "method main is Too Complex" when I use several conditions in if to analyze repetition of numbers. With less data in if it works, but I need all these comparisons.
//Verifica Repetições
if ((combinacao[0] != combinacao[1])
&& (combinacao[0] != combinacao[2])
&& (combinacao[0] != combinacao[3])
&& (combinacao[0] != combinacao[4])
&& (combinacao[0] != combinacao[5])
&& (combinacao[0] != combinacao[6])
&& (combinacao[0] != combinacao[7])
&& (combinacao[0] != combinacao[8])
&& (combinacao[0] != combinacao[9])
&& (combinacao[0] != combinacao[10])
&& (combinacao[0] != combinacao[11])
&& (combinacao[0] != combinacao[12])
&& (combinacao[0] != combinacao[13])
&& (combinacao[0] != combinacao[14])
&& (combinacao[0] != combinacao[15])
&& (combinacao[0] != combinacao[16])
&& (combinacao[0] != combinacao[17])
&& (combinacao[0] != combinacao[18])
&& (combinacao[0] != combinacao[19])
&& (combinacao[1] != combinacao[2])
&& (combinacao[1] != combinacao[3])
&& (combinacao[1] != combinacao[4])
&& (combinacao[1] != combinacao[5])
&& (combinacao[1] != combinacao[6])
&& (combinacao[1] != combinacao[7])
&& (combinacao[1] != combinacao[8])
&& (combinacao[1] != combinacao[9])
&& (combinacao[1] != combinacao[10])
&& (combinacao[1] != combinacao[11])
&& (combinacao[1] != combinacao[12])
&& (combinacao[1] != combinacao[13])
&& (combinacao[1] != combinacao[14])
&& (combinacao[1] != combinacao[15])
&& (combinacao[1] != combinacao[16])
&& (combinacao[1] != combinacao[17])
&& (combinacao[1] != combinacao[18])
&& (combinacao[1] != combinacao[19])
&& (combinacao[2] != combinacao[3])
&& (combinacao[2] != combinacao[4])
&& (combinacao[2] != combinacao[5])
&& (combinacao[2] != combinacao[6])
&& (combinacao[2] != combinacao[7])
&& (combinacao[2] != combinacao[8])
&& (combinacao[2] != combinacao[9])
&& (combinacao[2] != combinacao[10])
&& (combinacao[2] != combinacao[11])
&& (combinacao[2] != combinacao[12])
&& (combinacao[2] != combinacao[13])
&& (combinacao[2] != combinacao[14])
&& (combinacao[2] != combinacao[15])
&& (combinacao[2] != combinacao[16])
&& (combinacao[2] != combinacao[17])
&& (combinacao[2] != combinacao[18])
&& (combinacao[2] != combinacao[19])
&& (combinacao[3] != combinacao[4])
&& (combinacao[3] != combinacao[5])
&& (combinacao[3] != combinacao[6])
&& (combinacao[3] != combinacao[7])
&& (combinacao[3] != combinacao[8])
&& (combinacao[3] != combinacao[9])
&& (combinacao[3] != combinacao[10])
&& (combinacao[3] != combinacao[11])
&& (combinacao[3] != combinacao[12])
&& (combinacao[3] != combinacao[13])
&& (combinacao[3] != combinacao[14])
&& (combinacao[3] != combinacao[15])
&& (combinacao[3] != combinacao[16])
&& (combinacao[3] != combinacao[17])
&& (combinacao[3] != combinacao[18])
&& (combinacao[3] != combinacao[19])
&& (combinacao[4] != combinacao[5])
&& (combinacao[4] != combinacao[6])
&& (combinacao[4] != combinacao[7])
&& (combinacao[4] != combinacao[8])
&& (combinacao[4] != combinacao[9])
&& (combinacao[4] != combinacao[10])
&& (combinacao[4] != combinacao[11])
&& (combinacao[4] != combinacao[12])
&& (combinacao[4] != combinacao[13])
&& (combinacao[4] != combinacao[14])
&& (combinacao[4] != combinacao[15])
&& (combinacao[4] != combinacao[16])
&& (combinacao[4] != combinacao[17])
&& (combinacao[4] != combinacao[18])
&& (combinacao[4] != combinacao[19])
&& (combinacao[5] != combinacao[6])
&& (combinacao[5] != combinacao[7])
&& (combinacao[5] != combinacao[8])
&& (combinacao[5] != combinacao[9])
&& (combinacao[5] != combinacao[10])
&& (combinacao[5] != combinacao[11])
&& (combinacao[5] != combinacao[12])
&& (combinacao[5] != combinacao[13])
&& (combinacao[5] != combinacao[14])
&& (combinacao[5] != combinacao[15])
&& (combinacao[5] != combinacao[16])
&& (combinacao[5] != combinacao[17])
&& (combinacao[5] != combinacao[18])
&& (combinacao[5] != combinacao[19])
&& (combinacao[6] != combinacao[7])
&& (combinacao[6] != combinacao[8])
&& (combinacao[6] != combinacao[9])
&& (combinacao[6] != combinacao[10])
&& (combinacao[6] != combinacao[11])
&& (combinacao[6] != combinacao[12])
&& (combinacao[6] != combinacao[13])
&& (combinacao[6] != combinacao[14])
&& (combinacao[6] != combinacao[15])
&& (combinacao[6] != combinacao[16])
&& (combinacao[6] != combinacao[17])
&& (combinacao[6] != combinacao[18])
&& (combinacao[6] != combinacao[19])
&& (combinacao[7] != combinacao[8])
&& (combinacao[7] != combinacao[9])
&& (combinacao[7] != combinacao[10])
&& (combinacao[7] != combinacao[11])
&& (combinacao[7] != combinacao[12])
&& (combinacao[7] != combinacao[13])
&& (combinacao[7] != combinacao[14])
&& (combinacao[7] != combinacao[15])
&& (combinacao[7] != combinacao[16])
&& (combinacao[7] != combinacao[17])
&& (combinacao[7] != combinacao[18])
&& (combinacao[7] != combinacao[19])
&& (combinacao[8] != combinacao[9])
&& (combinacao[8] != combinacao[10])
&& (combinacao[8] != combinacao[11])
&& (combinacao[8] != combinacao[12])
&& (combinacao[8] != combinacao[13])
&& (combinacao[8] != combinacao[14])
&& (combinacao[8] != combinacao[15])
&& (combinacao[8] != combinacao[16])
&& (combinacao[8] != combinacao[17])
&& (combinacao[8] != combinacao[18])
&& (combinacao[8] != combinacao[19])
&& (combinacao[9] != combinacao[10])
&& (combinacao[9] != combinacao[11])
&& (combinacao[9] != combinacao[12])
&& (combinacao[9] != combinacao[13])
&& (combinacao[9] != combinacao[14])
&& (combinacao[9] != combinacao[15])
&& (combinacao[9] != combinacao[16])
&& (combinacao[9] != combinacao[17])
&& (combinacao[9] != combinacao[18])
&& (combinacao[9] != combinacao[19])
&& (combinacao[10] != combinacao[11])
&& (combinacao[10] != combinacao[12])
&& (combinacao[10] != combinacao[13])
&& (combinacao[10] != combinacao[14])
&& (combinacao[10] != combinacao[15])
&& (combinacao[10] != combinacao[16])
&& (combinacao[10] != combinacao[17])
&& (combinacao[10] != combinacao[18])
&& (combinacao[10] != combinacao[19])
&& (combinacao[11] != combinacao[12])
&& (combinacao[11] != combinacao[13])
&& (combinacao[11] != combinacao[14])
&& (combinacao[11] != combinacao[15])
&& (combinacao[11] != combinacao[16])
&& (combinacao[11] != combinacao[17])
&& (combinacao[11] != combinacao[18])
&& (combinacao[11] != combinacao[19])
&& (combinacao[12] != combinacao[13])
&& (combinacao[12] != combinacao[14])
&& (combinacao[12] != combinacao[15])
&& (combinacao[12] != combinacao[16])
&& (combinacao[12] != combinacao[17])
&& (combinacao[12] != combinacao[18])
&& (combinacao[12] != combinacao[19])
&& (combinacao[13] != combinacao[14])
&& (combinacao[13] != combinacao[15])
&& (combinacao[13] != combinacao[16])
&& (combinacao[13] != combinacao[17])
&& (combinacao[13] != combinacao[18])
&& (combinacao[13] != combinacao[19])
&& (combinacao[14] != combinacao[15])
&& (combinacao[14] != combinacao[16])
&& (combinacao[14] != combinacao[17])
&& (combinacao[14] != combinacao[18])
&& (combinacao[14] != combinacao[19])
&& (combinacao[15] != combinacao[16])
&& (combinacao[15] != combinacao[17])
&& (combinacao[15] != combinacao[18])
&& (combinacao[15] != combinacao[19])
&& (combinacao[16] != combinacao[17])
&& (combinacao[16] != combinacao[18])
&& (combinacao[16] != combinacao[19])
&& (combinacao[17] != combinacao[18])
&& (combinacao[17] != combinacao[19])
&& (combinacao[18] != combinacao[19])
) {
The main point here is that you are not supposed to make 200 comparisons in it
if
. The solution is to go through the vector and compare and build the result– Isac