当前位置: 首页>>代码示例>>Java>>正文


Java NewIssue.gap方法代码示例

本文整理汇总了Java中org.sonar.api.batch.sensor.issue.NewIssue.gap方法的典型用法代码示例。如果您正苦于以下问题:Java NewIssue.gap方法的具体用法?Java NewIssue.gap怎么用?Java NewIssue.gap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sonar.api.batch.sensor.issue.NewIssue的用法示例。


在下文中一共展示了NewIssue.gap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: savePreciseIssue

import org.sonar.api.batch.sensor.issue.NewIssue; //导入方法依赖的package包/类
private void savePreciseIssue(PreciseIssue issue) {
  NewIssue newIssue = sensorContext.newIssue();
  InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.primaryLocation().file())));

  newIssue
    .forRule(ruleKey(issue.check()))
    .at(newLocation(primaryFile, newIssue, issue.primaryLocation()));

  if (issue.cost() != null) {
    newIssue.gap(issue.cost());
  }

  InputFile secondaryFile;
  for (IssueLocation secondary : issue.secondaryLocations()) {
    secondaryFile = fileSystem.inputFile(fileSystem.predicates().is(secondary.file()));
    if (secondaryFile == null) {
      secondaryFile = primaryFile;
    }
    newIssue.addLocation(newLocation(secondaryFile, newIssue, secondary));
  }

  newIssue.save();
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:24,代码来源:IssueSaver.java

示例2: saveLineIssue

import org.sonar.api.batch.sensor.issue.NewIssue; //导入方法依赖的package包/类
private void saveLineIssue(LineIssue issue) {
  NewIssue newIssue = sensorContext.newIssue();
  InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.file())));

  NewIssueLocation primaryLocation = newIssue.newLocation()
    .message(issue.message())
    .on(primaryFile)
    .at(primaryFile.selectLine(issue.line()));

  newIssue
    .forRule(ruleKey(issue.check()))
    .at(primaryLocation);

  if (issue.cost() != null) {
    newIssue.gap(issue.cost());
  }

  newIssue.save();
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:20,代码来源:IssueSaver.java

示例3: savePreciseIssue

import org.sonar.api.batch.sensor.issue.NewIssue; //导入方法依赖的package包/类
private void savePreciseIssue(PreciseIssue issue) {
  NewIssue newIssue = sensorContext.newIssue();
  InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.primaryLocation().file())));

  newIssue
    .forRule(ruleKey(issue.check()))
    .at(newLocation(primaryFile, newIssue, issue.primaryLocation()));

  if (issue.cost() != null) {
    newIssue.gap(issue.cost());
  }

  InputFile secondaryFile;
  for (org.sonar.plugins.json.api.visitors.issue.IssueLocation secondary : issue.secondaryLocations()) {
    secondaryFile = fileSystem.inputFile(fileSystem.predicates().is(secondary.file()));
    if (secondaryFile == null) {
      secondaryFile = primaryFile;
    }
    newIssue.addLocation(newLocation(secondaryFile, newIssue, secondary));
  }

  newIssue.save();
}
 
开发者ID:racodond,项目名称:sonar-json-plugin,代码行数:24,代码来源:IssueSaver.java

示例4: saveFileIssue

import org.sonar.api.batch.sensor.issue.NewIssue; //导入方法依赖的package包/类
private void saveFileIssue(FileIssue issue) {
  NewIssue newIssue = sensorContext.newIssue();
  InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.file())));

  NewIssueLocation primaryLocation = newIssue.newLocation()
    .message(issue.message())
    .on(primaryFile);

  newIssue
    .forRule(ruleKey(issue.check()))
    .at(primaryLocation);

  if (issue.cost() != null) {
    newIssue.gap(issue.cost());
  }

  InputFile secondaryFile;
  for (IssueLocation secondary : issue.secondaryLocations()) {
    secondaryFile = fileSystem.inputFile(fileSystem.predicates().is(secondary.file()));
    if (secondaryFile == null) {
      secondaryFile = primaryFile;
    }
    newIssue.addLocation(newLocation(secondaryFile, newIssue, secondary));
  }

  newIssue.save();
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:28,代码来源:IssueSaver.java

示例5: saveFileIssue

import org.sonar.api.batch.sensor.issue.NewIssue; //导入方法依赖的package包/类
private void saveFileIssue(FileIssue issue) {
  NewIssue newIssue = sensorContext.newIssue();
  InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.file())));

  NewIssueLocation primaryLocation = newIssue.newLocation()
    .message(issue.message())
    .on(primaryFile);

  newIssue
    .forRule(ruleKey(issue.check()))
    .at(primaryLocation);

  if (issue.cost() != null) {
    newIssue.gap(issue.cost());
  }

  InputFile secondaryFile;
  for (org.sonar.plugins.json.api.visitors.issue.IssueLocation secondary : issue.secondaryLocations()) {
    secondaryFile = fileSystem.inputFile(fileSystem.predicates().is(secondary.file()));
    if (secondaryFile == null) {
      secondaryFile = primaryFile;
    }
    newIssue.addLocation(newLocation(secondaryFile, newIssue, secondary));
  }

  newIssue.save();
}
 
开发者ID:racodond,项目名称:sonar-json-plugin,代码行数:28,代码来源:IssueSaver.java


注:本文中的org.sonar.api.batch.sensor.issue.NewIssue.gap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。