It depends how you are travelling:
1: If you travel as a Non-Revenue passenger, this means when you received the ticket as stby ticket, from the airline itself.
For this tickets you have different priorities:
For example: I once travelled on AA in First Class on a A13 ticket, this means training for the airline! You have also the D2 ticket, is airline employee using his/her free tickets to go on vacation for example!
When U use this kind of tickets, and you whan't to make a chance to travel or in Business or in First Class, than you best look at the dresscode!
2: When you have a full fare First or Business Class ticket on AA for example: when you have a full "J" ticket for business, or a full "F" ticket for First Class, then is doesn't matter, then you can even sit in First with your short and T-shirt, sandals whatever.
This because you payed a full price, this is than the contrary with the free tickets, here you should look what you're wearing!