code: function calculateStatsPerFile(messages) {
      return messages.reduce((stat, message) => {
          if (message.fatal || message.severity === 2) {
              stat.errorCount++;
              if (message.fix) {
                  stat.fixableErrorCount++;
              }
          } else {
              stat.warningCount++;
              if (message.fix) {
                  stat.fixableWarningCount++;
              }
          }
          return stat;
      }, {
          errorCount: 0,
          warningCount: 0,
          fixableErrorCount: 0,
          fixableWarningCount: 0
      });
  }
docs: It will calculate the error and warning count for collection of messages per file
  @param {Object[]} messages - Collection of messages
  @returns {Object} Contains the stats
  @private