[IMP][TASK 10343] Don't copy the code tree when adding codes to it