public class NoSonarFilter extends Object implements IssueFilter
ScannerSides, must feed this filter by registering the lines that contain "NOSONAR". Note that filters are disabled for the issues reported by end-users from UI or web services.
|Constructor and Description|
|Modifier and Type||Method and Description|
since 5.0 use
Register lines in a file that contains the NOSONAR flag.
@Deprecated public NoSonarFilter addComponent(String componentKey, Set<Integer> noSonarLines)
public NoSonarFilter noSonarInFile(InputFile inputFile, Set<Integer> noSonarLines)
noSonarLines- Line number starts at 1 in a file
public boolean accept(FilterableIssue issue, IssueFilterChain chain)
acceptmethod is called for each
FilterableIssuecreated during analysis, to check if it has to be persisted. Examples of use cases are:
//NOSONARcomments, semantic annotations)
chainparameter allows for fine control of the filtering logic: it is each filter's duty to either pass the issue to the next filter, by calling the
IssueFilterChain.accept(org.sonar.api.scan.issue.filter.FilterableIssue)method, or return directly if the issue has to be accepted or not
issue- the issue being filtered
chain- the rest of the filters
trueto accept the issue,
falseto reject it,
IssueFilterChain.accept(org.sonar.api.scan.issue.filter.FilterableIssue)to let the other filters decide.
Copyright © 2009–2017 SonarSource. All rights reserved.