Cyclomatic complexity, invented in 1976, is a metric that scores a function based on the number of breaks in the flow, such as loops or conditionals. It helps in determining the number of tests needed to cover a function.