Your first step is to create a new Quality Gate that includes a condition on overall code. Then you need to make your build process wait for the Quality Gate results to be available. Without knowing anything about your process, I can’t tell you exactly how to do that, but it’s documented for Jenkins.