Parag Kadam
Parag Kadam

Reputation: 3850

How to ignore a java file from sonarqube inspection?

The sonar file in question gives false positives for duplicate blocks of code and I need to curb it at the file level. Is there any annotation or a configuration that can ignore the java class?

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;  

import com.fasterxml.jackson.annotation.JsonInclude;        
import java.io.Serializable;        

@JsonInclude(JsonInclude.Include.NON_NULL)        
@JsonIgnoreProperties(ignoreUnknown=true)        
public class SnbTransactionVo implements Serializable {            
    private static final long serialVersionUID = 7178997834378189890L;            
    private Integer cellComputerNo;            
    private String tradingDate;            
    

    public Integer getCellComputerNo() {        
           return cellComputerNo;    
    }
    public void setCellComputerNo(Integer cellComputerNo) {        
           this.cellComputerNo = cellComputerNo;    
    }    
    public String getTradingDate() {        
        return tradingDate;    
    }    
    public void setTradingDate(String tradingDate) {        
        this.tradingDate = tradingDate;    
    }

}

Upvotes: 0

Views: 608

Answers (1)

Sofyane MAKERRI
Sofyane MAKERRI

Reputation: 463

You can use this annotation : @java.lang.SuppressWarnings("squid:S00112") Where squid:S00112 is the Sonar ID issue

Upvotes: 1

Related Questions