From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
In order to offer rational criteria for a right moral decision, the [teleological ethical] theories mentioned above take account of the intention and consequences of human action. Certainly there is need to take into account both the intention — as Jesus forcefully insisted in clear disagreement with the scribes and Pharisees, who prescribed in great detail certain outward practices without paying attention to the heart (cf. Mk 7:20-21; Mt 15:19) — and the goods obtained and the evils avoided as a result of a particular act. Responsibility demands as much. But the consideration of these consequences, and also of intentions, is not sufficient for judging the moral quality of a concrete choice. The weighing of the goods and evils foreseeable as the consequence of an action is not an adequate method for determining whether the choice of that concrete kind of behaviour is “according to its species”, or “in itself”, morally good or bad, licit or illicit. The foreseeable consequences are part of those circumstances of the act, which, while capable of lessening the gravity of an evil act, nonetheless cannot alter its moral species.
Moreover, everyone recognizes the difficulty, or rather the impossibility, of evaluating all the good and evil consequences and effects — defined as pre-moral — of one’s own acts: an exhaustive rational calculation is not possible. How then can one go about establishing proportions which depend on a measuring, the criteria of which remain obscure? How could an absolute obligation be justified on the basis of such debatable calculations?
— Veritatis Splendor 77