In timeline order:
A project is under feature freeze when no further functional requirements will be accepted.
A project is feature complete when all features have been implemented. Code cleanup can occur after feature complete. This is often referred to as paying down technical debt. If you were looking for a marketing term to tell a client, you might refer to it as hardening, which has more confident sound to it than "cleaning up our huge barf mess."
A project is code complete when coders are done doing anything other than reacting to defect reports. Cleanup should not occur during this phase unless it is related to a defect.
A project is under code freeze when the coders are done coding anything at all, including defect fixes. Often the repository is locked at this stage, or if it isn't locked, it is subject to version control history audits with each and every build, to ensure no changes sneak into the code base.