Similar to idea as comic book code. This was an attempt by the movie industry to self censor and promote a specific set of values in its content.
The first iteration of it was created in 1927, and included rules like:
Banned: - Pointed profanity—by either title or lip—this includes the words God, Lord, Jesus, Christ, Hell, S.O.B., damn, Gawd - Any licentious or suggestive nudity—in fact or in silhouette - The illegal traffic in drugs; - Any inference of sex perversion; - Scenes of actual childbirth—in fact or in silhouette; - Ridicule of the clergy; - Willful offense to any nation, race or creed; and
Topics to be dealt with sensitivity: - The use of the Flag; - International Relations (avoid picturizing in an unfavorable light another country's religion, history, institutions, prominent people and citizenry); - The use of firearms; - Apparent cruelty to children and animals; - Technique of committing murder by whatever method; - Rape or attempted rape; - Man and woman in bed together; - Deliberate seduction of girls; - The institution of marriage; - Excessive or lustful kissing, particularly when one character or the other is a "heavy". [heavy here means "bad guy" or criminal]
There are many more, but the above captures the general flavor.
Competition eventually forced the industry to abandon the code. The industry instead adopted the G/PG/PG-13/R/X/X/XXX rating system.