A code violation in tennis is an action on a tennis court that is related to negative behavior by a player. Code violations are given out by referees according to different specific regulations. There are four questions that a chair umpire has to ask themselves in order to determine if an action is a code violation or not. If one of the criteria is met then the chair umpire has grounds to punish a player for a code violation
Usually if the chair umpire found there to be a code violation, there is a set procedure of punishments. First, the umpire will usually give a warning to a player. After the warning, if another code violation occurs, the player will receive a point penalty. After that point penalty, if another code violation occurs the player will be penalized a game.
Code violations are decided at the discretion of the chair umpire, something that has been in some controversy in the tennis world. The moment that most know is the 2018 US Open Women's final where Serena Williams was given a point penalty, and then a game penalty, by chair umpire Carlos Ramos. The warning was given for coaching, the point penalty was given for smashing her racket and the game penalty for "verbal abuse." Many argue that what Williams said was not speaking abusively and in fact less abusively than what many angry white male tennis players have said. The entire code violation system was thrown into question after this match.