§1. Unless they gave some signs of repentance before death, the following must be deprived of ecclesiastical funerals: 1/ notorious apostates, heretics, and schismatics; 2/ those who chose the cremation of their bodies for reasons contrary to Christian faith; 3/ other manifest sinners who cannot be granted ecclesiastical funerals without public scandal of the faithful.
§2. If any doubt occurs, the local ordinary is to be consulted, and his judgment must be followed.
Source: Code of Canon Law (Vatican.va)