org.sonar.api.measures.Metric.getUserManaged()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(125)

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

Metric.getUserManaged介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

@Test
 public void checkDefinitions() {
  CoreCustomMetrics coreCustomMetrics = new CoreCustomMetrics();
  List<Metric> metrics = coreCustomMetrics.getMetrics();
  assertThat(metrics.size()).isGreaterThan(2);
  for (Metric metric : metrics) {
   assertThat(metric.getUserManaged()).isTrue();
   assertThat(metric.getDomain()).isEqualTo("Management");
  }
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void shouldCreateMetricWithDefaultValues() {
 Metric metric = new Metric.Builder("foo", "Foo", Metric.ValueType.INT)
  .create();
 assertThat(metric.getBestValue()).isNull();
 assertThat(metric.getDescription()).isNull();
 assertThat(metric.getWorstValue()).isNull();
 assertThat(metric.getDirection()).isEqualTo(Metric.DIRECTION_NONE);
 assertThat(metric.getEnabled()).isTrue();
 assertThat(metric.getId()).isNull();
 assertThat(metric.getUserManaged()).isFalse();
 assertThat(metric.isHidden()).isFalse();
 assertThat(metric.isOptimizedBestValue()).isFalse();
}

代码示例来源:origin: SonarSource/sonarqube

@Override
 @Nonnull
 public MetricDto apply(@Nonnull Metric metric) {
  MetricDto dto = new MetricDto();
  dto.setId(metric.getId());
  dto.setKey(metric.getKey());
  dto.setDescription(metric.getDescription());
  dto.setShortName(metric.getName());
  dto.setBestValue(metric.getBestValue());
  dto.setDomain(metric.getDomain());
  dto.setEnabled(metric.getEnabled());
  dto.setDirection(metric.getDirection());
  dto.setHidden(metric.isHidden());
  dto.setQualitative(metric.getQualitative());
  dto.setValueType(metric.getType().name());
  dto.setOptimizedBestValue(metric.isOptimizedBestValue());
  dto.setUserManaged(metric.getUserManaged());
  dto.setWorstValue(metric.getWorstValue());
  dto.setDeleteHistoricalData(metric.getDeleteHistoricalData());
  dto.setDecimalScale(metric.getDecimalScale());
  return dto;
 }
}

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

public FakeGlobalRepositoriesLoader add(Metric metric) {
  Boolean optimizedBestValue = metric.isOptimizedBestValue();
  ref.metrics().add(new org.sonar.batch.protocol.input.Metric(metricId,
   metric.key(),
   metric.getType().name(),
   metric.getDescription(),
   metric.getDirection(),
   metric.getName(),
   metric.getQualitative(),
   metric.getUserManaged(),
   metric.getWorstValue(),
   metric.getBestValue(),
   optimizedBestValue != null ? optimizedBestValue : false));
  metricId++;
  return this;
 }
}

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

@Override
 @Nonnull
 public MetricDto apply(@Nonnull Metric metric) {
  MetricDto dto = new MetricDto();
  dto.setId(metric.getId());
  dto.setKey(metric.getKey());
  dto.setDescription(metric.getDescription());
  dto.setShortName(metric.getName());
  dto.setBestValue(metric.getBestValue());
  dto.setDomain(metric.getDomain());
  dto.setEnabled(metric.getEnabled());
  dto.setDirection(metric.getDirection());
  dto.setHidden(metric.isHidden());
  dto.setQualitative(metric.getQualitative());
  dto.setValueType(metric.getType().name());
  dto.setOptimizedBestValue(metric.isOptimizedBestValue());
  dto.setUserManaged(metric.getUserManaged());
  dto.setWorstValue(metric.getWorstValue());
  dto.setDeleteHistoricalData(metric.getDeleteHistoricalData());
  dto.setDecimalScale(metric.getDecimalScale());
  return dto;
 }
}

相关文章