import org.junit.Test;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.measures.Measure;
import org.sonar.api.resources.JavaFile;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.ProjectFileSystem;
import org.sonar.api.resources.Resource;
+import org.sonar.api.test.IsMeasure;
import org.sonar.test.TestUtils;
import java.io.File;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.argThat;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
public class JaCoCoOverallSensorTest {
- private final JacocoConfiguration configuration= mock(JacocoConfiguration.class);
+ private final JacocoConfiguration configuration = mock(JacocoConfiguration.class);
private final SensorContext context = mock(SensorContext.class);
private final ProjectFileSystem pfs = mock(ProjectFileSystem.class);
private final Project project = mock(Project.class);
- private final JaCoCoOverallSensor sensor = new JaCoCoOverallSensor(configuration);
+ private final JaCoCoOverallSensor sensor = new JaCoCoOverallSensor(configuration);
@Test
public void should_execute_on_project() {
sensor.analyse(project, context);
verify(context).getResource(resource);
- verify(context).saveMeasure(resource, new Measure(CoreMetrics.OVERALL_LINES_TO_COVER, 5.0));
- verify(context).saveMeasure(resource, new Measure(CoreMetrics.OVERALL_UNCOVERED_LINES, 0.0));
- verify(context).saveMeasure(resource, new Measure(CoreMetrics.OVERALL_COVERAGE_LINE_HITS_DATA, "3=1;6=1;7=1;10=1;11=1"));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_LINES_TO_COVER, 12.0)));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_UNCOVERED_LINES, 2.0)));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_COVERAGE_LINE_HITS_DATA, "3=1;6=1;7=1;10=1;11=1;14=1;15=1;17=1;18=1;20=1;23=0;24=0")));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_CONDITIONS_TO_COVER, 2.0)));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_UNCOVERED_CONDITIONS, 0.0)));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_CONDITIONS_BY_LINE, "14=2")));
+ verify(context).saveMeasure(eq(resource), argThat(new IsMeasure(CoreMetrics.OVERALL_COVERED_CONDITIONS_BY_LINE, (String) null)));
verifyNoMoreInteractions(context);
}
*/
package org.sonar.api.config;
+import com.google.common.collect.ImmutableList;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import javax.annotation.Nullable;
+import java.util.List;
+
/**
* @since 3.0
*/
}
}
- private String key;
- private String defaultValue;
- private String name;
- private PropertyType type = PropertyType.STRING;
- private String[] options;
- private String description;
- private String category;
- private boolean onProject = false;
- private boolean onModule = false;
- private boolean isGlobal = true;
- private boolean multiValues;
- private String propertySetKey;
- private PropertyFieldDefinition[] fields;
+ private final String key;
+ private final String defaultValue;
+ private final String name;
+ private final PropertyType type;
+ private final String[] options;
+ private final String description;
+ private final String category;
+ private final boolean onProject;
+ private final boolean onModule;
+ private final boolean isGlobal;
+ private final boolean multiValues;
+ private final String propertySetKey;
+ private final List<PropertyFieldDefinition> fields;
private PropertyDefinition(Property annotation) {
this.key = annotation.key();
this.type = fixType(annotation.key(), annotation.type());
this.options = annotation.options();
this.multiValues = annotation.multiValues();
- propertySetKey = annotation.propertySetKey();
- this.fields = PropertyFieldDefinition.create(annotation.fields());
+ this.propertySetKey = annotation.propertySetKey();
+ this.fields = ImmutableList.copyOf(PropertyFieldDefinition.create(annotation.fields()));
+ }
+
+ private PropertyDefinition(String key, PropertyType type, String[] options) {
+ this.key = key;
+ this.name = null;
+ this.defaultValue = null;
+ this.description = null;
+ this.isGlobal = true;
+ this.onProject = false;
+ this.onModule = false;
+ this.category = null;
+ this.type = type;
+ this.options = options;
+ this.multiValues = false;
+ this.propertySetKey = null;
+ this.fields = null;
}
private static PropertyType fixType(String key, PropertyType type) {
return type;
}
- private PropertyDefinition(String key, PropertyType type, String[] options) {
- this.key = key;
- this.type = type;
- this.options = options;
- }
-
public static PropertyDefinition create(Property annotation) {
return new PropertyDefinition(annotation);
}
/**
* @since 3.3
*/
- public PropertyFieldDefinition[] getFields() {
+ public List<PropertyFieldDefinition> getFields() {
return fields;
}
}
this.options = annotation.options();
}
- public static PropertyFieldDefinition[] create(PropertyField[] fields) {
+ public static List<PropertyFieldDefinition> create(PropertyField[] fields) {
List<PropertyFieldDefinition> definitions = Lists.newArrayList();
for (PropertyField field : fields) {
definitions.add(new PropertyFieldDefinition(field));
}
- return definitions.toArray(new PropertyFieldDefinition[definitions.size()]);
+ return definitions;
}
public String getKey() {
* @since 3.3
*/
public static final Metric OVERALL_COVERAGE = new Metric.Builder(OVERALL_COVERAGE_KEY, "Overall coverage", Metric.ValueType.PERCENT)
- .setDescription("Overall test coverage")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setWorstValue(0.0)
- .setBestValue(100.0)
- .create();
+ .setDescription("Overall test coverage")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setWorstValue(0.0)
+ .setBestValue(100.0)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_COVERAGE = new Metric.Builder(NEW_OVERALL_COVERAGE_KEY, "Overall new coverage", Metric.ValueType.PERCENT)
- .setDescription("Overall coverage of new/changed code")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setWorstValue(0.0)
- .setBestValue(100.0)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Overall coverage of new/changed code")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setWorstValue(0.0)
+ .setBestValue(100.0)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_LINES_TO_COVER = new Metric.Builder(OVERALL_LINES_TO_COVER_KEY, "Overall lines to cover", Metric.ValueType.INT)
- .setDescription("Overall lines to cover by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setQualitative(false)
- .setFormula(new SumChildValuesFormula(false))
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Overall lines to cover by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setQualitative(false)
+ .setFormula(new SumChildValuesFormula(false))
+ .setHidden(true)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_LINES_TO_COVER = new Metric.Builder(NEW_OVERALL_LINES_TO_COVER_KEY, "Overall new lines to cover", Metric.ValueType.INT)
- .setDescription("New lines to cover by all tests")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("New lines to cover by all tests")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setQualitative(false)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_UNCOVERED_LINES = new Metric.Builder(OVERALL_UNCOVERED_LINES_KEY, "Overall uncovered lines", Metric.ValueType.INT)
- .setDescription("Uncovered lines by all tests")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .create();
+ .setDescription("Uncovered lines by all tests")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setQualitative(false)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_UNCOVERED_LINES = new Metric.Builder(NEW_OVERALL_UNCOVERED_LINES_KEY, "Overall new lines uncovered", Metric.ValueType.INT)
- .setDescription("New lines that are not covered by any tests")
- .setDirection(Metric.DIRECTION_WORST)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .setBestValue(0.0)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("New lines that are not covered by any tests")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .setBestValue(0.0)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_LINE_COVERAGE = new Metric.Builder(OVERALL_LINE_COVERAGE_KEY, "Overall line coverage", Metric.ValueType.PERCENT)
- .setDescription("Line coverage by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .create();
+ .setDescription("Line coverage by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_LINE_COVERAGE = new Metric.Builder(NEW_OVERALL_LINE_COVERAGE_KEY, "Overall new line coverage", Metric.ValueType.PERCENT)
- .setDescription("Line coverage of added/changed code by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setWorstValue(0.0)
- .setBestValue(100.0)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Line coverage of added/changed code by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setWorstValue(0.0)
+ .setBestValue(100.0)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_COVERAGE_LINE_HITS_DATA = new Metric.Builder(OVERALL_COVERAGE_LINE_HITS_DATA_KEY, "Overall coverage hits by line", Metric.ValueType.DATA)
- .setDescription("Coverage hits by all tests and by line")
- .setDirection(Metric.DIRECTION_NONE)
- .setQualitative(false)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Coverage hits by all tests and by line")
+ .setDirection(Metric.DIRECTION_NONE)
+ .setQualitative(false)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_CONDITIONS_TO_COVER = new Metric.Builder(OVERALL_CONDITIONS_TO_COVER_KEY, "Overall branches to cover", Metric.ValueType.INT)
- .setDescription("Branches to cover by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(false)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Branches to cover by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(false)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .setHidden(true)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_CONDITIONS_TO_COVER = new Metric.Builder(NEW_OVERALL_CONDITIONS_TO_COVER_KEY, "Overall new branches to cover", Metric.ValueType.INT)
- .setDescription("New branches to cover by all tests")
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("New branches to cover by all tests")
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_UNCOVERED_CONDITIONS = new Metric.Builder(OVERALL_UNCOVERED_CONDITIONS_KEY, "Overall uncovered branches", Metric.ValueType.INT)
- .setDescription("Uncovered branches by all tests")
- .setDirection(Metric.DIRECTION_WORST)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .create();
+ .setDescription("Uncovered branches by all tests")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_UNCOVERED_CONDITIONS = new Metric.Builder(NEW_OVERALL_UNCOVERED_CONDITIONS_KEY, "Overall new branches uncovered", Metric.ValueType.INT)
- .setDescription("New branches that are not covered by any test")
- .setDirection(Metric.DIRECTION_WORST)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setFormula(new SumChildValuesFormula(false))
- .setBestValue(0.0)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("New branches that are not covered by any test")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setFormula(new SumChildValuesFormula(false))
+ .setBestValue(0.0)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_BRANCH_COVERAGE = new Metric.Builder(OVERALL_BRANCH_COVERAGE_KEY, "Overall branch coverage", Metric.ValueType.PERCENT)
- .setDescription("Branch coverage by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setWorstValue(0.0)
- .setBestValue(100.0)
- .create();
+ .setDescription("Branch coverage by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setWorstValue(0.0)
+ .setBestValue(100.0)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric NEW_OVERALL_BRANCH_COVERAGE = new Metric.Builder(NEW_OVERALL_BRANCH_COVERAGE_KEY, "Overall new branch coverage", Metric.ValueType.PERCENT)
- .setDescription("Branch coverage of new/changed code by all tests")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(true)
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setWorstValue(0.0)
- .setBestValue(100.0)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Branch coverage of new/changed code by all tests")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setWorstValue(0.0)
+ .setBestValue(100.0)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
* @since 3.3
*/
public static final Metric OVERALL_CONDITIONS_BY_LINE = new Metric.Builder(OVERALL_CONDITIONS_BY_LINE_KEY, "Overall branches by line", Metric.ValueType.DATA)
- .setDescription("Overall branches by all tests and by line")
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setDeleteHistoricalData(true)
- .create();
+ .setDescription("Overall branches by all tests and by line")
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setDeleteHistoricalData(true)
+ .create();
/**
* @since 3.3
/**
* @since 3.3
*/
- public static final Metric OVERALL_COVERED_CONDITIONS_BY_LINE = new Metric.Builder(OVERALL_COVERED_CONDITIONS_BY_LINE_KEY, "Overall covered branches by line", Metric.ValueType.DATA)
- .setDescription("Overall covered branches by all tests and by line")
- .setDomain(DOMAIN_OVERALL_TESTS)
- .setDeleteHistoricalData(true)
- .create();
-
+ public static final Metric OVERALL_COVERED_CONDITIONS_BY_LINE = new Metric.Builder(OVERALL_COVERED_CONDITIONS_BY_LINE_KEY, "Overall covered branches by line",
+ Metric.ValueType.DATA)
+ .setDescription("Overall covered branches by all tests and by line")
+ .setDomain(DOMAIN_OVERALL_TESTS)
+ .setDeleteHistoricalData(true)
+ .create();
// --------------------------------------------------------------------------------------------------------------------
//
package org.sonar.api.rules;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
}
}
+ private static final Function<Class<?>, PropertyType> TYPE_FOR_CLASS = Functions.forMap(
+ ImmutableMap.<Class<?>, PropertyType> builder()
+ .put(Integer.class, PropertyType.INTEGER)
+ .put(int.class, PropertyType.INTEGER)
+ .put(Float.class, PropertyType.FLOAT)
+ .put(float.class, PropertyType.FLOAT)
+ .put(Boolean.class, PropertyType.BOOLEAN)
+ .put(boolean.class, PropertyType.BOOLEAN)
+ .build(),
+ PropertyType.STRING);
+
@VisibleForTesting
static PropertyType guessType(Class<?> type) {
- if ((type == Integer.class) || (type == int.class)) {
- return PropertyType.INTEGER;
- } else if ((type == Float.class) || (type == float.class)) {
- return PropertyType.FLOAT;
- } else if ((type == Boolean.class) || (type == boolean.class)) {
- return PropertyType.BOOLEAN;
- }
- return PropertyType.STRING;
+ return TYPE_FOR_CLASS.apply(type);
}
}
PropertyDefinition def = PropertyDefinition.create(prop);
assertThat(def.getFields()).hasSize(2);
- assertThat(def.getFields()[0].getKey()).isEqualTo("first");
- assertThat(def.getFields()[0].getName()).isEqualTo("First");
- assertThat(def.getFields()[0].getDescription()).isEqualTo("Description");
- assertThat(def.getFields()[0].getType()).isEqualTo(PropertyType.STRING);
- assertThat(def.getFields()[0].getOptions()).containsOnly("A", "B");
- assertThat(def.getFields()[0].getIndicativeSize()).isEqualTo(20);
- assertThat(def.getFields()[1].getKey()).isEqualTo("second");
- assertThat(def.getFields()[1].getName()).isEqualTo("Second");
- assertThat(def.getFields()[1].getType()).isEqualTo(PropertyType.INTEGER);
- assertThat(def.getFields()[1].getOptions()).isEmpty();
- assertThat(def.getFields()[1].getIndicativeSize()).isEqualTo(5);
+ assertThat(def.getFields().get(0).getKey()).isEqualTo("first");
+ assertThat(def.getFields().get(0).getName()).isEqualTo("First");
+ assertThat(def.getFields().get(0).getDescription()).isEqualTo("Description");
+ assertThat(def.getFields().get(0).getType()).isEqualTo(PropertyType.STRING);
+ assertThat(def.getFields().get(0).getOptions()).containsOnly("A", "B");
+ assertThat(def.getFields().get(0).getIndicativeSize()).isEqualTo(20);
+ assertThat(def.getFields().get(1).getKey()).isEqualTo("second");
+ assertThat(def.getFields().get(1).getName()).isEqualTo("Second");
+ assertThat(def.getFields().get(1).getType()).isEqualTo(PropertyType.INTEGER);
+ assertThat(def.getFields().get(1).getOptions()).isEmpty();
+ assertThat(def.getFields().get(1).getIndicativeSize()).isEqualTo(5);
}
@Properties(@Property(key = "hello", name = "Hello"))
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.web.*;
+import org.sonar.api.web.DefaultTab;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.RequiredMeasures;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.RubyRailsPage;
+import org.sonar.api.web.UserRole;
+import org.sonar.api.web.View;
/**
* @since 2.7
@UserRole(UserRole.CODEVIEWER)
private static final class SourceTab implements RubyRailsPage {
public String getTemplate() {
- //not used, hardcoded in BrowseController
+ // not used, hardcoded in BrowseController
return "browse/index";
}
}
}
-
@NavigationSection(NavigationSection.RESOURCE_TAB)
@ResourceQualifier({Qualifiers.FILE, Qualifiers.CLASS})
@DefaultTab(metrics = {
- /* unit tests */
- CoreMetrics.COVERAGE_KEY, CoreMetrics.LINES_TO_COVER_KEY, CoreMetrics.UNCOVERED_LINES_KEY, CoreMetrics.LINE_COVERAGE_KEY,
- CoreMetrics.CONDITIONS_TO_COVER_KEY, CoreMetrics.UNCOVERED_CONDITIONS_KEY, CoreMetrics.BRANCH_COVERAGE_KEY,
- CoreMetrics.NEW_COVERAGE_KEY, CoreMetrics.NEW_UNCOVERED_LINES_KEY, CoreMetrics.NEW_LINE_COVERAGE_KEY,
- CoreMetrics.NEW_LINES_TO_COVER_KEY, CoreMetrics.NEW_BRANCH_COVERAGE_KEY, CoreMetrics.NEW_CONDITIONS_TO_COVER_KEY, CoreMetrics.NEW_UNCOVERED_CONDITIONS_KEY,
+ /* unit tests */
+ CoreMetrics.COVERAGE_KEY, CoreMetrics.LINES_TO_COVER_KEY, CoreMetrics.UNCOVERED_LINES_KEY, CoreMetrics.LINE_COVERAGE_KEY,
+ CoreMetrics.CONDITIONS_TO_COVER_KEY, CoreMetrics.UNCOVERED_CONDITIONS_KEY, CoreMetrics.BRANCH_COVERAGE_KEY,
+ CoreMetrics.NEW_COVERAGE_KEY, CoreMetrics.NEW_UNCOVERED_LINES_KEY, CoreMetrics.NEW_LINE_COVERAGE_KEY,
+ CoreMetrics.NEW_LINES_TO_COVER_KEY, CoreMetrics.NEW_BRANCH_COVERAGE_KEY, CoreMetrics.NEW_CONDITIONS_TO_COVER_KEY, CoreMetrics.NEW_UNCOVERED_CONDITIONS_KEY,
/* integration tests */
CoreMetrics.IT_COVERAGE_KEY, CoreMetrics.IT_LINES_TO_COVER_KEY, CoreMetrics.IT_UNCOVERED_LINES_KEY, CoreMetrics.IT_LINE_COVERAGE_KEY,
CoreMetrics.OVERALL_COVERAGE_KEY, CoreMetrics.OVERALL_LINES_TO_COVER_KEY, CoreMetrics.OVERALL_UNCOVERED_LINES_KEY, CoreMetrics.OVERALL_LINE_COVERAGE_KEY,
CoreMetrics.OVERALL_CONDITIONS_TO_COVER_KEY, CoreMetrics.OVERALL_UNCOVERED_CONDITIONS_KEY, CoreMetrics.OVERALL_BRANCH_COVERAGE_KEY,
CoreMetrics.NEW_OVERALL_COVERAGE_KEY, CoreMetrics.NEW_OVERALL_UNCOVERED_LINES_KEY, CoreMetrics.NEW_OVERALL_LINE_COVERAGE_KEY,
- CoreMetrics.NEW_OVERALL_LINES_TO_COVER_KEY, CoreMetrics.NEW_OVERALL_BRANCH_COVERAGE_KEY, CoreMetrics.NEW_OVERALL_CONDITIONS_TO_COVER_KEY, CoreMetrics.NEW_OVERALL_UNCOVERED_CONDITIONS_KEY
- })
+ CoreMetrics.NEW_OVERALL_LINES_TO_COVER_KEY, CoreMetrics.NEW_OVERALL_BRANCH_COVERAGE_KEY, CoreMetrics.NEW_OVERALL_CONDITIONS_TO_COVER_KEY,
+ CoreMetrics.NEW_OVERALL_UNCOVERED_CONDITIONS_KEY
+ })
@RequiredMeasures(anyOf = {CoreMetrics.COVERAGE_KEY, CoreMetrics.IT_COVERAGE_KEY, CoreMetrics.OVERALL_COVERAGE_KEY})
@UserRole(UserRole.CODEVIEWER)
private static final class CoverageTab implements RubyRailsPage {
public String getTemplate() {
- //not used, hardcoded in BrowseController
+ // not used, hardcoded in BrowseController
return "browse/index";
}
@NavigationSection(NavigationSection.RESOURCE_TAB)
@DefaultTab(metrics = {CoreMetrics.VIOLATIONS_DENSITY_KEY, CoreMetrics.WEIGHTED_VIOLATIONS_KEY, CoreMetrics.VIOLATIONS_KEY, CoreMetrics.BLOCKER_VIOLATIONS_KEY,
- CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY,
- CoreMetrics.NEW_VIOLATIONS_KEY, CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, CoreMetrics.NEW_MAJOR_VIOLATIONS_KEY,
- CoreMetrics.NEW_MINOR_VIOLATIONS_KEY, CoreMetrics.NEW_INFO_VIOLATIONS_KEY, CoreMetrics.ACTIVE_REVIEWS_KEY, CoreMetrics.UNASSIGNED_REVIEWS_KEY,
- CoreMetrics.UNPLANNED_REVIEWS_KEY, CoreMetrics.FALSE_POSITIVE_REVIEWS_KEY, CoreMetrics.UNREVIEWED_VIOLATIONS_KEY, CoreMetrics.NEW_UNREVIEWED_VIOLATIONS_KEY})
+ CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY,
+ CoreMetrics.NEW_VIOLATIONS_KEY, CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, CoreMetrics.NEW_MAJOR_VIOLATIONS_KEY,
+ CoreMetrics.NEW_MINOR_VIOLATIONS_KEY, CoreMetrics.NEW_INFO_VIOLATIONS_KEY, CoreMetrics.ACTIVE_REVIEWS_KEY, CoreMetrics.UNASSIGNED_REVIEWS_KEY,
+ CoreMetrics.UNPLANNED_REVIEWS_KEY, CoreMetrics.FALSE_POSITIVE_REVIEWS_KEY, CoreMetrics.UNREVIEWED_VIOLATIONS_KEY, CoreMetrics.NEW_UNREVIEWED_VIOLATIONS_KEY})
@ResourceQualifier({Qualifiers.VIEW, Qualifiers.SUBVIEW, Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.PACKAGE, Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.CLASS,
Qualifiers.UNIT_TEST_FILE})
@UserRole(UserRole.CODEVIEWER)
private static final class ViolationsTab implements RubyRailsPage {
public String getTemplate() {
- //not used, hardcoded in BrowseController
+ // not used, hardcoded in BrowseController
return "browse/index";
}
@UserRole(UserRole.CODEVIEWER)
private static final class DuplicationsTab implements RubyRailsPage {
public String getTemplate() {
- //not used, hardcoded in BrowseController
+ // not used, hardcoded in BrowseController
return "browse/index";
}