org.sonar.api.resources.Project.isRoot()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中org.sonar.api.resources.Project.isRoot()方法的一些代码示例,展示了Project.isRoot()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.isRoot()方法的具体详情如下:
包路径:org.sonar.api.resources.Project
类名称:Project
方法名:isRoot

Project.isRoot介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

/**
 * @return the qualifier of the current object
 */
@Override
public String getQualifier() {
 return isRoot() ? Qualifiers.PROJECT : Qualifiers.MODULE;
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

/**
 * @return whether the current project is a module
 */
public boolean isModule() {
 return !isRoot();
}

代码示例来源:origin: octo-technology/sonar-objective-c

public boolean shouldExecuteOnProject(final Project project) {
  return project.isRoot() && fileSystem.languages().contains(ObjectiveC.KEY);
}

代码示例来源:origin: octo-technology/sonar-objective-c

public boolean shouldExecuteOnProject(final Project project) {
  return project.isRoot() && fileSystem.languages().contains(ObjectiveC.KEY);
}

代码示例来源:origin: org.codehaus.sonar.dotnet.tests/sonar-dotnet-tests-library

@Override
public void analyse(Project project, SensorContext context) {
 if (project.isRoot()) {
  analyze(context, new UnitTestResults());
 }
}

代码示例来源:origin: org.codehaus.sonar-plugins.dotnet/sonar-dotnet-plugin

/**
 * {@inheritDoc}
 */
public boolean shouldExecuteOnProject(Project project) {
 if (project.isRoot() || !isLanguageSupported(project.getLanguageKey())) {
  return false;
 }
 boolean skipMode = MODE_SKIP.equalsIgnoreCase(getExecutionMode());
 if (skipMode) {
  LOG.info("{} plugin won't execute as it is set to 'skip' mode.", getToolName());
  return false;
 }
 return true;
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch

@Override
public void onProjectAnalysis(ProjectAnalysisEvent event) {
 Project module = event.getProject();
 if (event.isStart()) {
  decoratorsProfiler = new DecoratorsProfiler();
  currentModuleProfiling = new ModuleProfiling(module, system);
 } else {
  currentModuleProfiling.stop();
  modulesProfilings.put(module, currentModuleProfiling);
  long moduleTotalTime = currentModuleProfiling.totalTime();
  println("");
  println(" -------- Profiling of module " + module.getName() + ": " + TimeUtils.formatDuration(moduleTotalTime) + " --------");
  println("");
  Properties props = new Properties();
  currentModuleProfiling.dump(props);
  println("");
  println(" -------- End of profiling of module " + module.getName() + " --------");
  println("");
  String fileName = module.getKey() + "-profiler.properties";
  dumpToFile(props, BatchUtils.cleanKeyForFilename(fileName));
  totalProfiling.merge(currentModuleProfiling);
  if (module.isRoot() && !module.getModules().isEmpty()) {
   dumpTotalExecutionSummary();
  }
 }
}

代码示例来源:origin: org.codehaus.sonar/sonar-batch

@Override
public void onProjectAnalysis(ProjectAnalysisEvent event) {
 Project module = event.getProject();
 if (event.isStart()) {
  decoratorsProfiler = new DecoratorsProfiler();
  currentModuleProfiling = new ModuleProfiling(module, system);
 } else {
  currentModuleProfiling.stop();
  modulesProfilings.put(module, currentModuleProfiling);
  long moduleTotalTime = currentModuleProfiling.totalTime();
  println("");
  println(" -------- Profiling of module " + module.getName() + ": " + TimeUtils.formatDuration(moduleTotalTime) + " --------");
  println("");
  Properties props = new Properties();
  currentModuleProfiling.dump(props);
  println("");
  println(" -------- End of profiling of module " + module.getName() + " --------");
  println("");
  String fileName = module.getKey() + "-profiler.properties";
  dumpToFile(props, BatchUtils.cleanKeyForFilename(fileName));
  totalProfiling.merge(currentModuleProfiling);
  if (module.isRoot() && !module.getModules().isEmpty()) {
   dumpTotalExecutionSummary();
  }
 }
}

代码示例来源:origin: org.codehaus.sonar/sonar-batch

/**
 * Executed on each module
 */
@Override
public void execute(Project module) {
 pi.execute(module);
 eventBus.fireEvent(new ProjectAnalysisEvent(module, true));
 executeInitializersPhase();
 if (phases.isEnabled(Phases.Phase.SENSOR)) {
  // Index and lock the filesystem
  indexFs();
  // Log detected languages and their profiles after FS is indexed and languages detected
  profileVerifier.execute();
  // Initialize issue exclusions
  initIssueExclusions();
  sensorsExecutor.execute(sensorContext);
 }
 if (module.isRoot()) {
  localIssueTracking();
  issuesReport();
  publishReportJob();
 }
 cleanMemory();
 eventBus.fireEvent(new ProjectAnalysisEvent(module, false));
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch

/**
 * Executed on each module
 */
public void execute(Project module) {
 pi.execute(module);
 eventBus.fireEvent(new ProjectAnalysisEvent(module, true));
 executeInitializersPhase();
 // Index and lock the filesystem
 indexFs();
 // Log detected languages and their profiles after FS is indexed and languages detected
 profileVerifier.execute();
 // Initialize issue exclusions
 initIssueExclusions();
 sensorsExecutor.execute(sensorContext);
 if (module.isRoot()) {
  if (analysisMode.isIssues()) {
   localIssueTracking();
   issuesCallback();
  } else {
   computeDuplications();
  }
  issuesReport();
  publishReportJob();
  postJobsExecutor.execute(sensorContext);
 }
 cleanMemory();
 eventBus.fireEvent(new ProjectAnalysisEvent(module, false));
}

代码示例来源:origin: org.codehaus.sonar/sonar-batch

if (module.isRoot()) {
 jsonReport.execute();

相关文章