In To Kill a Mockingbird, what literary device is used in this quote: “The Governor was eager to scrape a few barnacles off the ship of state.”
This is actually an implied metaphor. Remember that a metaphor is a literary device that compares one thing to something else without using the words "like" or "as" (that would be a simile). Metaphors can be direct, when the comparison is directly asserted - for example David is a lion - or implied, where we are left to detect the comparison that is being made ourselves. For example, David roared out his defiance against the opposing team.
In the example you have given, the metaphor is comparing the governor to a barrier reef or a big rock which would rub against ships in the water and scrape barnacles off the side of the ship. Clearly this comparison is saying that the Governor wants to reform the state (which is compared to a ship) and make it more "seaworthy" or efficient, by getting rid of wearisome bureaucracy that does not make it run efficiently.