code: function coverage(data, type) {
    var comparisionFunc;
    var n = 0;
  
    function isCovered(val) {
      return (val > 0);
    }
  
    function isMissed(val) {
      return !isCovered(val);
    }
  
    if (type === 'covered') {
      comparisionFunc = isCovered;
    }
    else if (type === 'missed') {
      comparisionFunc = isMissed;
    }
    else {
      throw new Error('Invalid type: ' + type);
    }
  
    var len = Object.keys(data.lines).length;
  
    for (var i = 0; i < len; ++i) {
      if (data.lines[i] !== null && comparisionFunc(data.lines[i])) {
        ++n;
      }
    }
  
    return n;
  }
docs: Total coverage for the given file data.
  
  @param  {Array} data
  @return {Type}