Pods are damaged or have fungal infections should be discarded and not included in the harvest.
It is best to harvest cocoa regularly so that pods do not get over-ripe.
Over-ripe pods are more likely to get fungal diseases which affect the beans which should then not be used.