/* * Ada Sonar Plugin * Copyright (C) 2010 Akram Ben Aissi * dev@sonar.codehaus.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.plugins.ada.core; import org.sonar.api.measures.Metrics; import org.sonar.api.measures.Metric; import org.sonar.api.measures.CoreMetrics; import java.util.List; import java.util.Arrays; public class AdaMetrics implements Metrics { public static final Metric MESSAGE = new Metric("message_key", "Message", "This is a metric to store a well known message", Metric.ValueType.STRING, -1, false, CoreMetrics.DOMAIN_GENERAL); public static final Metric RANDOM = new Metric("random", "Random", "Random value", Metric.ValueType.FLOAT, Metric.DIRECTION_BETTER, false, CoreMetrics.DOMAIN_GENERAL); // getMetrics() method is defined in the Metrics interface and is used by // Sonar to retrieve the list of new Metric public List<Metric> getMetrics() { return Arrays.asList(MESSAGE, RANDOM); } }