Avoiding a judgement has nothing to do with your credit report. Yes you file file bankruptcy before a judgement is obtained so that your credit report does not include that fact.
Judgments are not something that is reported to credit bureaus.
Yes. It is better to file for bankruptcy before a judgment is issued against you. Most civil suits for unsecured debts will be dismissed after the filing of your bankruptcy. Note however, your question showed concerns of what may appear on your credit report (3 major credit bureaus), - although the judgment may not appear, the bankruptcy will. Bankruptcy generally remains on your credit report for 10 years.
I would recommend you speaking with an attorney in your area — weigh your options of settling the civil suit; filing for bankruptcy; and the overall effect on your credit.
This answer is made available for educational purposes only as well as to give general information and a general understanding of the law, not to provide specific legal advice. By using this answer the users understands that there is no attorney client relationship between you and the answer publisher. The answer should not be used as a substitute for competent legal advice from a licensed professional attorney in your state.
Typically, it's better to file your bankruptcy before a judgment is entered, as the entry of the judgment could attach to your home or result in the garnishment of your bank account(s) or wages, which can be VERY disruptive and discouraging! Worrying about your credit report with a judgment looming is like closing the barn door after the horse has fled: your credit is ALREADY shot! If your credit report is in tatters, bankruptcy is going to stabilize it and reverse the downward slide of your credit score FASTER than trying to play wack-a-mole with your creditors one by one. Get moving! :)
The comments above are a general discussion of the topic raised and not intended as actual legal advice