The Torah tells us that Noach lived for 950 years (בראשית ט':כ"ט), and he is plainly described in an earlier Posuk as a צדיק תמים, a righteous and whole-hearted man (שם ו':ט'). However, that Posuk (שם) then says "בדורותיו", "in his generation." As pointed out by Rashi (שם בד"ה בדורותיו), some of the rabbis look at this word positively, saying that despite the terrible setting in which Noach lived, where all people were corrupt and involved with things like stealing, killing and adultery, Noach still walked with Hashem, obeying the six Mitzvos which Hashem had earlier given to Adam. These commentaries thus say that if Noach was indeed such a big Tzaddik and was able to ignore his surroundings and survive among so many evil people, then we can only imagine how great of a Tzaddik he would have become had he lived in the times of other Tzaddikim who would have influenced him positively.
There are however, others who disagree and look at the word בדורותיו in a negative fashion. When the Torah says "in his generation," it means to teach that he was a Tzaddik only in his generation, but if he had lived during another generation, he might not have been recognized as such a Tzaddik. Nevertheless, Noach's ability to not be affected at all by his neighboring evil surroundings is amazing. He was not enticed by the soothsayers, astrologers, enchanters or idolaters; he paid them no attention. The righteousness of this Tzaddik was so great that it maintained the whole world until the מבול, the Great Flood. Noach may have been righteous only in relation to his generation, but that is still significant, and he may be compared to a homeless man with fifty dollars who is a rich man in the eyes of his penniless friends. According to all views, then, it is praiseworthy that this whole-hearted man didn't allow himself to be influenced by his wicked neighbors in any way, even subjecting himself to humiliation and ridicule from others.
Interestingly, however, Noach is quoted in one Midrash as saying to Hashem that there is no difference between himself and everybody else. He too is guilty of sinning. In what way did Noach the Tzaddik sin? Some say that Noach sinned by not having chastised his fellow evil neighbors. This is why the flood waters are described in the Haftarah as מי נח, the waters of Noach ישעיה נ"ד:ט'(). The waters of the flood were at least partially as a result of his not convincing the people of his time to do Teshuvah as was his responsibility. Perhaps this is why some consider Noach a Tzaddik only in comparison to the wicked people of his time. As explained by Rashi שם בד"ה את(), unlike Avraham Avinu who was able to strengthen himself and walk in righteousness by himself, Noach needed Hashem's support within his evil surroundings to maintain his righteousness. This may be because Noach was not as secure in his righteousness as is seen by the fact that he did not influence others to be like him.