001 /*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
019 */
020 package org.sonar.plugins.squid;
021
022 import org.sonar.api.*;
023 import org.sonar.plugins.squid.decorators.*;
024
025 import java.util.Arrays;
026 import java.util.List;
027
028 @Properties({
029 @Property(key = SquidPluginProperties.SQUID_ANALYSE_ACCESSORS_PROPERTY,
030 defaultValue = SquidPluginProperties.SQUID_ANALYSE_ACCESSORS_DEFAULT_VALUE + "",
031 name = "Separate accessors",
032 description = "Flag whether Squid should separate accessors (getters/setters) from methods. " +
033 "In that case, accessors are not counted in metrics such as complexity or API documentation.",
034 project = true,
035 global = true,
036 category = CoreProperties.CATEGORY_JAVA,
037 type = PropertyType.BOOLEAN),
038 @Property(key = SquidPluginProperties.FIELDS_TO_EXCLUDE_FROM_LCOM4_COMPUTATION,
039 defaultValue = SquidPluginProperties.FIELDS_TO_EXCLUDE_FROM_LCOM4_COMPUTATION_DEFAULT_VALUE,
040 name = "List of fields to exclude from LCOM4 computation",
041 description = "Some fields should not be taken into account when computing LCOM4 measure as they " +
042 "unexpectedly and artificially decrease the LCOM4 measure. "
043 + "The best example is a logger used by all methods of a class. " +
044 "All field names to exclude from LCOM4 computation must be separated by a comma.",
045 project = true,
046 global = true,
047 category = CoreProperties.CATEGORY_JAVA),
048 @Property(
049 key = CoreProperties.DESIGN_SKIP_DESIGN_PROPERTY,
050 defaultValue = "" + CoreProperties.DESIGN_SKIP_DESIGN_DEFAULT_VALUE,
051 name = "Skip design analysis",
052 project = true,
053 global = true,
054 category = CoreProperties.CATEGORY_JAVA,
055 type = PropertyType.BOOLEAN)
056 })
057 public final class SquidPlugin extends SonarPlugin {
058
059 public List getExtensions() {
060 return Arrays.asList(
061 SquidSensor.class,
062 SquidRuleRepository.class,
063 JavaSourceImporter.class,
064 FileComplexityDistributionDecorator.class,
065 FunctionComplexityDistributionBuilder.class,
066 ClassesDecorator.class,
067 ChidamberKemererDistributionBuilder.class,
068 FunctionsDecorator.class);
069 }
070
071 }