"(22)For I have kept the ways of the LORDAnd have not acted wickedly against my God... (25)According to my cleanness before His eyes." -2 Samuel 22:22,25
It is difficult to believe verse 22 without reading verse 25. David would not be blameless in our eyes. In our eyes, David is an adulterer and murderer.
In God's mercy-tinted eyes, David is forgiven and blameless. How God sees us is all that is truly important.