The Code Gate is a secret door with a random code. The code is different every play through so there is no right answer.
You can figure out the code by accepting quests from Master Mcleans men.
The Code Gate is located under the bridge beside Master Mcleans outpost.
To open the gate you must enter the correct code.