def METHOD_NAME(cls):
    """Check that all m2m fields have a defined ``through`` model.
    Returns
    -------
    List[checks.CheckMessage]
        A list of the check messages representing problems found on the model.
    """
    fields_by_model = _get_fields_by_source_model(cls)
    errors = []
    model_full_name = f"{cls._meta.app_label}.{cls._meta.object_name}"
    m2m_fields = [
        field
        for field in cls._meta.get_fields()
        if isinstance(field, models.ManyToManyField)
    ]
    for field in m2m_fields:
        # ignore if defined in a model outside the scope
        if fields_by_model[field.name]._meta.app_label not in CHECKED_APPS:
            continue
        if field.remote_field.through._meta.auto_created:
            errors.append(
                checks.Error(
                    f"The field '{field.name}' of the model '{model_full_name}' is a "
                    "ManyToManyField but without a 'through' model defined",
                    hint=f"Add the attribute 'through' to the field '{field.name}' of the "
                    "model '{model_full_name}' and define the appropriate model",
                    obj=cls,
                    id="marsha.models.E009",
                )
            )
    return errors