本文整理汇总了Java中org.sonar.squidbridge.ProgressReport类的典型用法代码示例。如果您正苦于以下问题:Java ProgressReport类的具体用法?Java ProgressReport怎么用?Java ProgressReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressReport类属于org.sonar.squidbridge包,在下文中一共展示了ProgressReport类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: analyseFiles
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@VisibleForTesting
protected void analyseFiles(
SensorContext context,
List<TreeVisitor> treeVisitors,
Iterable<InputFile> inputFiles,
ProgressReport progressReport) {
boolean success = false;
try {
for (InputFile inputFile : inputFiles) {
if (context.isCancelled()) {
throw new CancellationException("Analysis interrupted because the SensorContext is in cancelled state");
}
analyseFile(context, inputFile, treeVisitors);
progressReport.nextFile();
}
success = true;
} catch (CancellationException e) { //NOSONAR
// do not propagate the exception
LOG.debug(e.toString());
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:antowski,项目名称:sonar-onec,代码行数:24,代码来源:OneCSensor.java
示例2: analyzeFiles
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@com.google.common.annotations.VisibleForTesting
protected void analyzeFiles(SensorContext sensorContext, ProgressReport progressReport) {
boolean success = false;
try {
for (InputFile inputFile : sensorContext.fileSystem().inputFiles(mainFilePredicate)){
analyse(sensorContext, inputFile);
}
progressReport.nextFile();
success = true;
} catch (CancellationException e) {
// do not propagate the exception
LOG.debug(e.toString());
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:silverbulleters,项目名称:sonar-gherkin,代码行数:20,代码来源:GherkinSquidSensor.java
示例3: stopProgressReport
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
private static void stopProgressReport(ProgressReport progressReport, boolean success) {
if (success) {
progressReport.stop();
} else {
progressReport.cancel();
}
}
开发者ID:antowski,项目名称:sonar-onec,代码行数:8,代码来源:OneCSensor.java
示例4: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext sensorContext) {
checks = checks(checkFactory, customRulesDefinition);
List<TreeVisitor> treeVisitors = treeVisitors(sensorContext, checks, noSonarFilter);
List<InputFile> filesToAnalyze = filesToAnalyze(fileSystem);
setParsingErrorCheckIfActivated(treeVisitors);
ProgressReport progressReport = new ProgressReport(
"Report about progress of " + analyzerName() + " analyzer",
TimeUnit.SECONDS.toMillis(10));
progressReport.start(filesToAnalyze.stream().map(InputFile::file).collect(Collectors.toList()));
issueSaver = new IssueSaver(sensorContext, checks);
List<Issue> issues = new ArrayList<>();
boolean success = false;
try {
for (InputFile inputFile : filesToAnalyze(fileSystem)) {
LOG.debug("Analyzing " + inputFile.absolutePath() + "...");
issues.addAll(analyzeFile(sensorContext, inputFile, treeVisitors));
progressReport.nextFile();
}
saveSingleFileIssues(issues);
success = true;
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:31,代码来源:AbstractLanguageAnalyzerSensor.java
示例5: stopProgressReport
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
private static void stopProgressReport(ProgressReport progressReport, boolean success) {
if (success) {
progressReport.stop();
} else {
progressReport.cancel();
}
}
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:8,代码来源:AbstractLanguageAnalyzerSensor.java
示例6: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext sensorContext) {
List<TreeVisitor> treeVisitors = Lists.newArrayList();
treeVisitors.addAll(checks.visitorChecks());
treeVisitors.add(new SyntaxHighlighterVisitor(sensorContext));
treeVisitors.add(new MetricsVisitor(sensorContext));
setParsingErrorCheckIfActivated(treeVisitors);
ProgressReport progressReport = new ProgressReport("Report about progress of Cucumber Gherkin analyzer", TimeUnit.SECONDS.toMillis(10));
progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate)));
issueSaver = new IssueSaver(sensorContext, checks);
List<Issue> issues = new ArrayList<>();
boolean success = false;
try {
for (InputFile inputFile : fileSystem.inputFiles(mainFilePredicate)) {
issues.addAll(analyzeFile(sensorContext, inputFile, treeVisitors));
progressReport.nextFile();
}
saveSingleFileIssues(issues);
saveCrossFileIssues();
success = true;
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:racodond,项目名称:sonar-gherkin-plugin,代码行数:29,代码来源:GherkinSquidSensor.java
示例7: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext sensorContext) {
List<TreeVisitor> treeVisitors = Lists.newArrayList();
treeVisitors.addAll(checks.visitorChecks());
treeVisitors.add(new SyntaxHighlighterVisitor(sensorContext));
treeVisitors.add(new MetricsVisitor(sensorContext));
setParsingErrorCheckIfActivated(treeVisitors);
ProgressReport progressReport = new ProgressReport("Report about progress of Java Properties analyzer", TimeUnit.SECONDS.toMillis(10));
progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate)));
issueSaver = new IssueSaver(sensorContext, checks);
List<Issue> issues = new ArrayList<>();
boolean success = false;
try {
for (InputFile inputFile : fileSystem.inputFiles(mainFilePredicate)) {
issues.addAll(analyzeFile(sensorContext, inputFile, treeVisitors));
progressReport.nextFile();
}
saveSingleFileIssues(issues);
saveCrossFileIssues();
success = true;
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:racodond,项目名称:sonar-jproperties-plugin,代码行数:29,代码来源:JavaPropertiesSquidSensor.java
示例8: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext sensorContext) {
List<TreeVisitor> treeVisitors = Lists.newArrayList();
treeVisitors.addAll(checks.visitorChecks());
treeVisitors.add(new SyntaxHighlighterVisitor(sensorContext));
treeVisitors.add(new MetricsVisitor(sensorContext));
setParsingErrorCheckIfActivated(treeVisitors);
ProgressReport progressReport = new ProgressReport("Report about progress of JSON analyzer", TimeUnit.SECONDS.toMillis(10));
progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate)));
issueSaver = new IssueSaver(sensorContext, checks);
List<Issue> issues = new ArrayList<>();
boolean success = false;
try {
for (InputFile inputFile : fileSystem.inputFiles(mainFilePredicate)) {
LOG.debug("Analyzing " + inputFile.absolutePath() + "...");
issues.addAll(analyzeFile(sensorContext, inputFile, treeVisitors));
progressReport.nextFile();
}
saveSingleFileIssues(issues);
success = true;
} finally {
stopProgressReport(progressReport, success);
}
}
开发者ID:racodond,项目名称:sonar-json-plugin,代码行数:29,代码来源:JSONSquidSensor.java
示例9: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext context) {
List<TreeVisitor> treeVisitors = Lists.newArrayList();
ProgressReport progressReport = new ProgressReport(
"Report about progress of 1C:Enterprise 7.7 analyzer",
TimeUnit.SECONDS.toMillis(10));
progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate)));
analyseFiles(context, treeVisitors, fileSystem.inputFiles(mainFilePredicate), progressReport);
//MetricsVisitor metricsVisitor = new MetricsVisitor(context,fileLinesContextFactory);
//treeVisitors.add(metricsVisitor);
}
开发者ID:antowski,项目名称:sonar-onec,代码行数:18,代码来源:OneCSensor.java
示例10: execute
import org.sonar.squidbridge.ProgressReport; //导入依赖的package包/类
@Override
public void execute(SensorContext sensorContext) {
LOG.debug(sensorContext.getSonarQubeVersion() + " started ");
ProgressReport report = new ProgressReport("Progress report about of Gherkin analyzer", TimeUnit.SECONDS.toMillis(10));
report.start(Lists.newArrayList(sensorContext.fileSystem().files(mainFilePredicate)));
analyzeFiles(sensorContext, report);
}
开发者ID:silverbulleters,项目名称:sonar-gherkin,代码行数:12,代码来源:GherkinSquidSensor.java
注:本文中的org.sonar.squidbridge.ProgressReport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论