Factorizing the polynomial of a code