OpenBible produced this “Sentiment Analysis of the Bible” visualization. Black means something positive is happening while red represents something bad:
Things start off well with creation, turn negative with Job and the patriarchs, improve again with Moses, dip with the period of the judges, recover with David, and have a mixed record (especially negative when Samaria is around) during the monarchy. The exilic period isn’t as negative as you might expect, nor the return period as positive. In the New Testament, things start off fine with Jesus, then quickly turn negative as opposition to his message grows. The story of the early church, especially in the epistles, is largely positive.
It may be misleading, though. It’s possible that a particular book including a particularly horrific section could still be drawn in black if it’s surrounded by other, “more positive” verses.
Still, it’s an interesting way to analyze a huge book, and it’s clear that there’s plenty of bad mixed in with the good — even in the New Testament.