Software complexity is "a measure of resources expended by a system [human or other] while interacting with a piece of software to perform a given task."
One feature which all of these [theoretical] approaches have in common is that they begin with certain characteristics of the software and attempt to determine what effect they might have on the difficulty of the various programmer tasks.
A more useful approach would be first to analyze the processes involved in programmer tasks, as well as the parameters which govern the effort involved in those processes. From this point one can deduce, or at least make informed guesses, about which code characteristics will affect those parameters.
Cant et. al, 1995
[A cognitive model] seeks to explain basic mental processes and their interactions; processes such as perceiving, learning, remembering, problem solving, and decision making.
Busemeyer and Diederich, 2010
Cognitive Complexity Metric - Cant et. al, 1995
(p encode-letter =goal> isa read-letters state attend =visual> isa text value =letter1 ?imaginal> buffer empty ==> =goal> state wait +imaginal> isa array letter1 =letter1 )
a = 4 b = 3 print a + b c = 7 d = 2 print c + d e = "5" f = "3" print e + f
a = 4 b = 3 print a + b
a = 4, categorize as variable assignment
ain DM as number with value 4
b = 3, categorize as variable assignment
bin DM as number with value 3
print a + b, categorize as print line
afrom DM (delay)
bfrom DM (delay)
a = 4 b = 3 print a + b c = 7 d = 2 print c + d e = 5 f = 3 print e + f
c = 7 d = 2 b = 3 f = 3 a = 4 e = 5 print a + b print c + d print e + f
Software Design - Cognitive Aspects (Détienne, 2001)