Code complexity can be measured using various metrics, such as the number of lines of code, the depth of nested elements, and the use of inline styles versus external stylesheets. Tools like Litmus and Email on Acid can help you analyze the complexity of your email code and provide insights on how to optimize it.