def METHOD_NAME(self):
    """Returns total number of errors and warnings."""
    # TODO(cutwater): Replace with SQL query
    errors, warnings = 0, 0
    for msg in self.messages:
        if msg['level'] == 'ERROR':
            errors += 1
        elif msg['level'] == 'WARNING':
            warnings += 1
    return errors, warnings