]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4853 Remove support of LCOM4
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 29 Nov 2013 09:49:48 +0000 (10:49 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 29 Nov 2013 09:50:04 +0000 (10:50 +0100)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/web/Lcom4Viewer.java [deleted file]
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/lcom4_viewer.html.erb [deleted file]
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecorator.java [deleted file]
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/LCOM4Widget.java [deleted file]
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb [deleted file]
plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecoratorTest.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java

index 906a18d2e37214eac6df67f3438738e0684cc647..784eac8912443fdce5c5dfd2164046ca4998c844 100644 (file)
@@ -46,7 +46,6 @@ import org.sonar.plugins.core.sensors.*;
 import org.sonar.plugins.core.technicaldebt.NewTechnicalDebtDecorator;
 import org.sonar.plugins.core.technicaldebt.TechnicalDebtDecorator;
 import org.sonar.plugins.core.timemachine.*;
-import org.sonar.plugins.core.web.Lcom4Viewer;
 import org.sonar.plugins.core.web.TestsViewer;
 import org.sonar.plugins.core.widgets.*;
 import org.sonar.plugins.core.widgets.issues.*;
@@ -213,7 +212,6 @@ public final class CorePlugin extends SonarPlugin {
       Periods.class,
 
       // pages
-      Lcom4Viewer.class,
       TestsViewer.class,
 
       // measure filters
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/web/Lcom4Viewer.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/web/Lcom4Viewer.java
deleted file mode 100644 (file)
index beef656..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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  02110-1301, USA.
- */
-package org.sonar.plugins.core.web;
-
-import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.web.*;
-
-@RequiredMeasures(allOf = {CoreMetrics.LCOM4_KEY})
-@NavigationSection(NavigationSection.RESOURCE_TAB)
-@UserRole(UserRole.USER)
-@ResourceQualifier(Qualifiers.CLASS)
-@DefaultTab(metrics = {"lcom4", "lcom4_blocks"})
-public class Lcom4Viewer extends AbstractRubyTemplate implements RubyRailsPage {
-
-  public String getId() {
-    return "lcom4_viewer";
-  }
-
-  public String getTitle() {
-    return "LCOM4";
-  }
-
-  @Override
-  protected String getTemplatePath() {
-    return "/org/sonar/plugins/core/web/lcom4_viewer.html.erb";
-  }
-}
index edb6a0390c8ba6db408f1ff41cc9a35795ae669e..fef6493b36ec8941ef086d41b3b37b385724f6c2 100644 (file)
@@ -382,7 +382,6 @@ user_groups.page=Groups
 users.page=Users
 violations.page=Violations
 update_center.page=Update Center
-lcom4_viewer.page=LCOM4
 deletion.page=Deletion
 update_key.page=Update Key
 project_quality_profiles.page=Quality Profiles
@@ -1150,12 +1149,6 @@ widget.treemap-widget.property.colorMetric.description=Metric used for square co
 widget.treemap-widget.property.heightInPercents.name=Height
 widget.treemap-widget.property.heightInPercents.description=Height in percents of width
 
-widget.lcom4.name=LCOM4
-widget.lcom4.description=Reports on LCOM4 average and distribution.
-widget.lcom4.title=LCOM4
-widget.lcom4.per_class.suffix=\ /class
-widget.lcom4.files_having_lcom_greater_than_one=\ files having LCOM4>1
-
 widget.rfc.name=Response for Class
 widget.rfc.description=Reports on RFC average and distribution.
 widget.rfc.title=Response for Class
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/lcom4_viewer.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/lcom4_viewer.html.erb
deleted file mode 100644 (file)
index 1b23f7f..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<style type="text/css">
-  table#lcom4blocks {
-    width: 100%;
-  }
-
-  table#lcom4blocks td {
-    vertical-align: top;
-  }
-
-  table#lcom4blocks td.lcom4BlockIndex {
-    font-size: 130%;
-    padding-top: 10px;
-    text-align: center;
-    width: 2em;
-  }
-
-  table.lcom4block {
-    background-color: #EFEFEF;
-    border: 1px solid #DDD;
-    border-right: none;
-    width: 100%;
-    margin-top: 10px;
-  }
-
-  table.lcom4block td {
-    height: 22px;
-    line-height: 22px;
-    vertical-align: middle;
-  }
-
-  table.lcom4block td img {
-    vertical-align: middle;
-  }
-
-  table.lcom4block td.lcom4Qualifier {
-    width: 20px;
-  }
-</style>
-
-<%
-   lcom4 = measure('lcom4')
-   lcom4_blocks = measure('lcom4_blocks')
-%>
-<div class="tab_header" id="source_header">
-  <p>
-    <span><%= Metric.by_key('lcom4').description -%>: </span>
-    <span id="m_lcom4" class="big"><%= lcom4 ? number_with_precision(lcom4.value(), :precision => 0) : '-' -%></span>
-  </p>
-</div>
-
-<%
-   if lcom4_blocks && lcom4_blocks.data
-%>
-  <table id="lcom4blocks">
-    <tbody>
-    <%
-       blocks = JSON(lcom4_blocks.data)
-       blocks.each_with_index do |block, index|
-    %>
-      <tr id="lcom4block_<%= index+1 -%>">
-        <td class="lcom4BlockIndex">
-          <%= index+1 -%>
-        </td>
-        <td>
-          <table cellspacing="0" cellpadding="0" class="lcom4block">
-            <tbody>
-            <% block.each do |hash| %>
-              <tr id="">
-                <td align="left" class="lcom4Qualifier">
-                  <%= image_tag "q/#{hash['q']}.png" -%>
-                </td>
-                <td><%= hash['n'] -%></td>
-              </tr>
-            <% end %>
-            </tbody>
-          </table>
-        </td>
-      </tr>
-    <%
-       end
-    %>
-    </tbody>
-  </table>
-<%
-   end
-%>
\ No newline at end of file
index 7cb74ef381c042d46cc5c6427ac49d30b041e3da..7ebb93528e0f446ddea524d47f7134cec36590c5 100644 (file)
@@ -26,11 +26,9 @@ import org.sonar.plugins.design.batch.FileTangleIndexDecorator;
 import org.sonar.plugins.design.batch.MavenDependenciesSensor;
 import org.sonar.plugins.design.batch.PackageTangleIndexDecorator;
 import org.sonar.plugins.design.batch.ProjectDsmDecorator;
-import org.sonar.plugins.design.batch.SuspectLcom4DensityDecorator;
 import org.sonar.plugins.design.ui.libraries.GwtLibrariesPage;
 import org.sonar.plugins.design.ui.page.GwtDesignPage;
 import org.sonar.plugins.design.ui.widgets.FileDesignWidget;
-import org.sonar.plugins.design.ui.widgets.LCOM4Widget;
 import org.sonar.plugins.design.ui.widgets.PackageDesignWidget;
 import org.sonar.plugins.design.ui.widgets.ResponseForClassWidget;
 
@@ -45,14 +43,12 @@ public class DesignPlugin extends SonarPlugin {
         ProjectDsmDecorator.class,
         PackageTangleIndexDecorator.class,
         FileTangleIndexDecorator.class,
-        SuspectLcom4DensityDecorator.class,
         GwtLibrariesPage.class,
 
         // UI
         GwtDesignPage.class,
         FileDesignWidget.class,
         PackageDesignWidget.class,
-        LCOM4Widget.class,
         ResponseForClassWidget.class);
   }
 }
diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecorator.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecorator.java
deleted file mode 100644 (file)
index b722957..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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  02110-1301, USA.
- */
-package org.sonar.plugins.design.batch;
-
-import org.sonar.api.batch.Decorator;
-import org.sonar.api.batch.DecoratorContext;
-import org.sonar.api.batch.DependedUpon;
-import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.measures.Measure;
-import org.sonar.api.measures.MeasureUtils;
-import org.sonar.api.measures.Metric;
-import org.sonar.api.resources.Project;
-import org.sonar.api.resources.Resource;
-import org.sonar.api.resources.ResourceUtils;
-import org.sonar.api.resources.Scopes;
-
-import java.util.Collection;
-import java.util.List;
-
-public class SuspectLcom4DensityDecorator implements Decorator {
-
-  public boolean shouldExecuteOnProject(Project project) {
-    return true;
-  }
-
-  @DependedUpon
-  public final Metric generatesMetric() {
-    return CoreMetrics.SUSPECT_LCOM4_DENSITY;
-  }
-
-  public void decorate(Resource resource, DecoratorContext context) {
-    if (ResourceUtils.isFile(resource)) {
-      // do nothing
-    } else if (Scopes.isDirectory(resource)) {
-      decorateDirectory(context);
-
-    } else if (Scopes.isProject(resource)) {
-      decorateProject(context);
-    }
-  }
-
-  private void decorateProject(DecoratorContext context) {
-    double total = 0.0;
-    int totalFiles = 0;
-
-    List<DecoratorContext> children = context.getChildren();
-    boolean hasLcom4=false;
-    for (DecoratorContext child : children) {
-      int files = MeasureUtils.getValue(child.getMeasure(CoreMetrics.FILES), 0.0).intValue();
-      totalFiles += files;
-      Measure childSuspectDensity = child.getMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY);
-      if (childSuspectDensity!=null && childSuspectDensity.getValue()!=null) {
-        hasLcom4=true;
-        total += childSuspectDensity.getValue() * files;
-      }
-    }
-
-    if (hasLcom4 && totalFiles > 0) {
-      context.saveMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY, total / totalFiles);
-    }
-  }
-
-  private void decorateDirectory(DecoratorContext context) {
-    Collection<Measure> fileLcoms = context.getChildrenMeasures(CoreMetrics.LCOM4);
-    double files = MeasureUtils.getValue(context.getMeasure(CoreMetrics.FILES), 0.0);
-    if (!fileLcoms.isEmpty() && files>0.0) {
-      double suspectFiles = 0.0;
-
-      // directory children are files
-      for (Measure fileLcom : fileLcoms) {
-        if (MeasureUtils.getValue(fileLcom, 0.0) > 1.0) {
-          suspectFiles++;
-        }
-      }
-      double density = (suspectFiles / files) * 100.0;
-      context.saveMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY, density);
-    }
-  }
-}
diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/LCOM4Widget.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/LCOM4Widget.java
deleted file mode 100644 (file)
index 11b203a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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  02110-1301, USA.
- */
-package org.sonar.plugins.design.ui.widgets;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.RubyRailsWidget;
-import org.sonar.api.web.UserRole;
-import org.sonar.api.web.WidgetCategory;
-
-@UserRole(UserRole.USER)
-@WidgetCategory({"Design"})
-public final class LCOM4Widget extends AbstractRubyTemplate implements RubyRailsWidget {
-
-  public String getId() {
-    return "lcom4";
-  }
-
-  public String getTitle() {
-    return "LCOM4";
-  }
-
-  @Override
-  protected String getTemplatePath() {
-    return "/org/sonar/plugins/design/ui/widgets/lcom4.html.erb";
-  }
-}
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb
deleted file mode 100644 (file)
index a827d0a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<%
-  lcom=measure('lcom4')
-  if lcom
-    lcom_distribution=measure('lcom4_distribution')
-    suspect_lcom4_density=measure('suspect_lcom4_density')
-    
-    display_chart = suspect_lcom4_density && suspect_lcom4_density.value>1.0 && lcom_distribution && !lcom_distribution.data.blank?
-%>
-<table width="100%">
-  <tbody>
-    <tr>
-      <td valign="top" width="<%= display_chart ? '50' : '100' -%>%">
-        <div class="dashbox">
-          <h3><%= message('widget.lcom4.title') -%></h3>
-          <p>
-            <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span><%= message('widget.lcom4.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%>
-          </p>
-          <p>
-            <%= format_measure(suspect_lcom4_density, :suffix => message('widget.lcom4.files_having_lcom_greater_than_one'), :url => url_for_drilldown('lcom4')) %> <%= dashboard_configuration.selected_period? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%>
-          </p>
-        </div>
-      </td>
-
-      <%
-        if display_chart
-          query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(lcom_distribution.data)
-      %>
-      <td valign="top" width="50px">
-        <a href="<%= url_for_drilldown('lcom4') -%>"><%= chart(query, :id => 'lcom4_distribution', :alt => '') -%></a>
-      </td>
-      <% end %>
-
-    </tr>
-  </tbody>
-</table>
-<% end %>
diff --git a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecoratorTest.java b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/SuspectLcom4DensityDecoratorTest.java
deleted file mode 100644 (file)
index 9c85627..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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  02110-1301, USA.
- */
-package org.sonar.plugins.design.batch;
-
-import org.junit.Test;
-import org.sonar.api.batch.DecoratorContext;
-import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.measures.Measure;
-import org.sonar.api.resources.JavaFile;
-import org.sonar.api.resources.JavaPackage;
-import org.sonar.api.resources.Project;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.mockito.Mockito.*;
-
-public class SuspectLcom4DensityDecoratorTest {
-
-  @Test
-  public void shouldNotDecorateFiles() {
-    DecoratorContext context = mock(DecoratorContext.class);
-    when(context.getMeasure(CoreMetrics.FILES)).thenReturn(new Measure(CoreMetrics.FILES, 1.0));
-    when(context.getMeasure(CoreMetrics.LCOM4)).thenReturn(newLcom4(3));
-
-    SuspectLcom4DensityDecorator decorator = new SuspectLcom4DensityDecorator();
-    decorator.decorate(new JavaFile("org.foo.Bar"), context);
-
-    verify(context, never()).saveMeasure(eq(CoreMetrics.SUSPECT_LCOM4_DENSITY), anyDouble());
-  }
-
-  @Test
-  public void shouldComputeDensityOnPackages() {
-    DecoratorContext context = mock(DecoratorContext.class);
-    when(context.getMeasure(CoreMetrics.FILES)).thenReturn(new Measure(CoreMetrics.FILES, 4.0));
-    when(context.getChildrenMeasures(CoreMetrics.LCOM4)).thenReturn(Arrays.asList(newLcom4(1), newLcom4(3), newLcom4(5), newLcom4(1)));
-
-    SuspectLcom4DensityDecorator decorator = new SuspectLcom4DensityDecorator();
-    decorator.decorate(new JavaPackage("org.foo"), context);
-
-    verify(context).saveMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY, 50.0);
-  }
-
-  @Test
-  public void shouldConsolidateDensityOnProjects() {
-    List<DecoratorContext> children = Arrays.asList(
-        newContext(3, 20.0),
-        newContext(0, 0.0),
-        newContext(5, 50.0));
-
-    DecoratorContext context = mock(DecoratorContext.class);
-    when(context.getChildren()).thenReturn(children);
-
-    SuspectLcom4DensityDecorator decorator = new SuspectLcom4DensityDecorator();
-    decorator.decorate(new Project("Foo"), context);
-
-    verify(context).saveMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY, (20.0*3 + 50.0*5) / (3.0+5.0));
-  }
-
-  @Test
-  public void doNotComputeDensityWhenLcom4IsMissing() {
-    DecoratorContext context = mock(DecoratorContext.class);
-    when(context.getMeasure(CoreMetrics.FILES)).thenReturn(new Measure(CoreMetrics.FILES, 4.0));
-    when(context.getChildrenMeasures(CoreMetrics.LCOM4)).thenReturn(Collections.<Measure>emptyList());
-
-    SuspectLcom4DensityDecorator decorator = new SuspectLcom4DensityDecorator();
-    decorator.decorate(new JavaPackage("org.foo"), context);
-
-    verify(context, never()).saveMeasure(eq(CoreMetrics.SUSPECT_LCOM4_DENSITY), anyDouble());
-  }
-
-  private Measure newLcom4(int lcom4) {
-    return new Measure(CoreMetrics.LCOM4, (double) lcom4);
-  }
-
-  private DecoratorContext newContext(int files, double density) {
-    DecoratorContext context = mock(DecoratorContext.class);
-    when(context.getMeasure(CoreMetrics.FILES)).thenReturn(new Measure(CoreMetrics.FILES, (double) files));
-    when(context.getMeasure(CoreMetrics.SUSPECT_LCOM4_DENSITY)).thenReturn(new Measure(CoreMetrics.SUSPECT_LCOM4_DENSITY, density));
-    return context;
-  }
-}
index ba65a553a2f68fc696b80cb88645312b56928d75..9b812b0a1ed178f90f11c150cef6e5860d45f889 100644 (file)
@@ -1663,7 +1663,16 @@ public final class CoreMetrics {
       .setFormula(new SumChildDistributionFormula().setMinimumScopeToPersist(Scopes.DIRECTORY))
       .create();
 
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final String LCOM4_KEY = "lcom4";
+
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final Metric LCOM4 = new Metric.Builder(LCOM4_KEY, "LCOM4", Metric.ValueType.FLOAT)
       .setDescription("Lack of Cohesion of Functions")
       .setDirection(Metric.DIRECTION_WORST)
@@ -1673,7 +1682,16 @@ public final class CoreMetrics {
       .setFormula(new WeightedMeanAggregationFormula(CoreMetrics.FILES, false))
       .create();
 
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final String LCOM4_BLOCKS_KEY = "lcom4_blocks";
+
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final Metric LCOM4_BLOCKS = new Metric.Builder(LCOM4_BLOCKS_KEY, "LCOM4 blocks", Metric.ValueType.DATA)
       .setDescription("LCOM4 blocks")
       .setDirection(Metric.DIRECTION_NONE)
@@ -1683,7 +1701,16 @@ public final class CoreMetrics {
       .setDeleteHistoricalData(true)
       .create();
 
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final String LCOM4_DISTRIBUTION_KEY = "lcom4_distribution";
+
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final Metric LCOM4_DISTRIBUTION = new Metric.Builder(LCOM4_DISTRIBUTION_KEY, "Class distribution /LCOM4", Metric.ValueType.DISTRIB)
       .setDescription("Class distribution /LCOM4")
       .setDirection(Metric.DIRECTION_NONE)
@@ -1692,7 +1719,16 @@ public final class CoreMetrics {
       .setFormula(new SumChildDistributionFormula().setMinimumScopeToPersist(Scopes.DIRECTORY))
       .create();
 
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final String SUSPECT_LCOM4_DENSITY_KEY = "suspect_lcom4_density";
+
+  /**
+   * @deprecated in 4.1. See http://jira.codehaus.org/browse/SONAR-4853
+   */
+  @Deprecated
   public static final Metric SUSPECT_LCOM4_DENSITY = new Metric.Builder(SUSPECT_LCOM4_DENSITY_KEY, "Suspect LCOM4 density", Metric.ValueType.PERCENT)
       .setDescription("Density of classes having LCOM4>1")
       .setDirection(Metric.DIRECTION_WORST)