code name vs pet name

code name

noun
  • A name used to clandestinely identify somebody or something, either for military or espionage purposes, or for commercial confidentiality. 

pet name

noun
  • A nickname, especially a name used by those in love with one another. 

  • Used other than figuratively or idiomatically: see pet, name. 

How often have the words code name and pet name occurred in a corpus of books? (source: Google Ngram Viewer )