AI code quality increasingly considers readability beyond mere functionality. Cyclomatic Complexity, introduced by Thomas McCabe in 1976, counts linearly independent paths, indicating testability and potential bug risk. Cognitive Complexity, a more recent metric, measures human understanding difficulty by penalizing nested structures and logic shifts. Halstead Metrics analyze operator and operand distribution to estimate code volume, difficulty, and potential bugs, guiding AI to generate more maintainable code.