Rather than trying to solve the problem in one go break it into managable chunks.

For example you might define an incorrect positioned peg as one that is the colour of one of the secret pegs but is not same colour as the peg in the equivilent secret code position. Now your method just needs to calls two methods to determine these facts and returns a result accordingly eg

Code:
for (int col = 0; col < SIZE; col++) {
    if ( isColourInCode(board[row][col]) && !isCorrectPosition(column, board[row][col]) ) 
        incorrectCount++;
    }
Now you need to provide code for these two methods which are simpler to code and probably reusable in other parts of your code.

  • isColourInCode() just iterates over the secret code and returns true if any of the pegs are of the given colour.
  • isCorrectPosition() just checks the secret peg at the given column and returns true if the peg is the given colour.