Code 1 signals either a total or imminent disaster, a possible invasion, or indicates that the Federation is either currently or about to be engaged in open warfare with a hostile power. The code requires all Starfleet personnel within the affected area to immediately assume a 'war' footing or posture. It is also colloquially known as "Defense Alert", or a "Priority One Alert". In 2267, the Enterprise received a Code 1 message from Starfleet Command stating they were at war with the Klingon Empire (TOS: "Errand of Mercy", "The Trouble with Tribbles", "The Alternative Factor")
Code 3 Message from Starfleet for only Captain and First Officer only. All other personal will only be notify only when Starfleet deems it clear. (DC Comic Star Trek 1986 Annual 2)
Code 4 During the act of war, no Federation Ship will not fire upon any humanitarian relief ship of the opposing side. Only in self defense only when a Federation Ship may fire upon another ship.*
Code 5 When a federation ship has been taken over by hostile forces and the self-destruct could not be activated. That the commanding officer in charge instigate ship-wide computer lock out, so any hostile forces will not be have control so the Federation Ship will not be used for any acts of violence. *
Code 6 Message for Admirals only, Admiral may discuss at anytime with the Captain and first Officer if need to be. If information is told to Captain and first officer, please be advise that Code 3 must be follow.
Code 7 Any ships approaching a planet must open channels.
Code 7-01 Any ships approaching a planet must not have weapons active
Code 7-02 Any ships approaching a planet does not respond will be consider a hostile vessel. Ships captain has grounds to insure the safety of his ship and its crew.
Code 7-03 Any ships approaching must have shields down.
Code 7-04 Any planet that is in Federation Space is under protection and deserves all rights and privileges that is allow according to Starfleet rules.
Code 7-05 Any planet may refuse any ship to approach. All members of the Federation must respect the broader of another race.
Code 47 an ultra-secure communications protocol. So secure that all traces of a Code 47 transmission or communication are automatically wiped from all computer records. (TNG: "Conspiracy")
Code Factor 1 Starfleet code meaning invasion status. An unexplained time-warp distortion that swept across the galaxy in 2267 caused Starfleet Command to issue a Code Factor 1 (TOS: The Alternative Factor)