         conditionalNestFactor: NEST_FACTOR
         loopNestFactor: NEST_FACTOR
       )
+      halstead: countHalstead m.body
   metrics.methodCount = metrics.methods.length
   metrics.propertyCount = (m for m in cls.body when m.member is 'property').length
   metrics.innerClassCount = (m for m in cls.body when m.member is 'inner_class').length

    else 0
  return cc

calculateBlockComplexity = (block, options) ->
 cc = 0
 for statement in block
   cc += calculateStatementComplexity statement, options
 cc

calculateComplexity = (methodBody, options) ->
  options ?= {}

  cc = calculateBlockComplexity methodBody, options
  cc += 1 if methodBody[methodBody.length-1].statement isnt 'return'
  cc

countHalstead = (methodBody) ->
  countBlockHalstead methodBody

lineCount = (pos) ->
  pos.last_line - pos.first_line + 1
