What are the duties of a Pope? Can a pope be "good" or "bad" in this perspective? Is there something like "bad" or "good" popes"?

What is the meaning when a pope is qualified "good" or "bad", with the historical perspective. For instance, some popes have bad reputation in the history books. Did they fail to their duties? What were their duties? Have you got some examples of popes who failed to them in the history?

At the opposite, can some popes being considered as very exemplary?
The Duties of a Pope
Pope St. Pius X mentions his papal duties at the very beginning of his encyclical against Modernism, Pascendi Dominici gregis (1907):

The office [of the papacy] divinely committed to Us of feeding the Lord's flock* has especially this duty assigned to it by Christ, namely, to guard with the greatest vigilance the deposit of the faith delivered to the saints, rejecting the profane novelties of words and oppositions of knowledge falsely so called.

*cf. John 21:15-17, where Jesus tells St. Peter, the first Pope, to feed his flock (i.e., to give Christians the truths necessary for salvation).
St. Thomas Aquinas's commentary on John 21:15-17 overviews the duties of a pope. A pope is to feed the flock (i.e., all Christians) by:


teaching: &quot;And I will give you shepherds after my own heart, who will feed you with knowledge and understanding&quot; (Jer 3:15).

example: &quot;Set the believers an example in speech and conduct, in love, in faith, in purity&quot; (1 Tim 4:12); &quot;Upon the mountain heights of Israel,&quot; that is, in the excellence of great men, &quot;shall be their pasture&quot; (Ez 34:14).

being offered temporal help: &quot;Woe, shepherds of Israel who have been feeding yourselves! Should not shepherds feed the sheep?&quot; (Ez 34:2).



So, a pope must teach (cf. the Great Commission, Mt. 28:19: &quot;Going therefore, teach ye all nations&quot;), sanctify, and rule (yes, even temporally; cf. Cdl. Manning's The Temporal Power of the Vicar of Christ).
The Council of Florence defined, and the First Vatican Council (Pastor Æternus cap. 4) reiterated, that

the Roman Pontiff is the true vicar of Christ, and the head of the whole Church, and the father and teacher of all Christians; and that to him in blessed Peter was delivered by our Lord Jesus Christ the full power of feeding, ruling, and governing the whole Church.

Vatican I called this the Roman Pontiff's &quot;pastoral duty&quot; or pastorale munus (ibid.).
Pope Benedict XIV wrote (Pastoralis Romani Pontificis):

the duties of his [i.e., of a Pope's] office, are principally and above all manifested in maintaining and conserving the unity and integrity of the Catholic faith, without which it is impossible to please God.

&quot;Bad Popes&quot;
Bad popes would be those who do not live up to their aforementioned duties.
Regarding &quot;bad popes&quot; and such bad &quot;popes&quot; that they are not even popes, see this article:

The “Bad Popes” Argument