In American or British English, using "code" as a countable noun to refer to source code is wrong.
For an American source, see Merriam Webster's entry for the word "code", which gives the following definition...
instructions for a computer (as within a piece of software)
... with the following example usage, as a mass noun:
writing code for a new app
For a British source, see the entry in Collins which says:
Computer code is a system or language for expressing information and instructions in a form which can be understood by a computer.
However, in Indian English, "code" is typically used as a countable noun. I have observed this usage from reading posts by Indians on Stack Overflow, from teaching in India, from being offered programming jobs by Indian companies, and from working with Indian colleagues. Indians will talk about writing "codes" (incorrect in British or American English) or even writing "a code", as in the example in the question here. For an example in the wild, see this page on an outsourcing website called Outsource2india which uses the word "codes" in this way five times.
This is one of the many ways that Indian English differs from the English that Americans or Brits like me are used to. Of course, whether Indian English is proper English in the first place is subjective; attitudes vary, among both Indians and non-Indians, on the question of whether Indian English is a legitimate dialect in its own right like British and American English are, or merely a collection of erroneous (and perhaps even mildly embarrassing) deviations from correct English, as spoken by the Queen. As such, I leave the judgement of whether this usage is "wrong" as a matter for you to decide according to your own beliefs.