]> source.dussan.org Git - sonarqube.git/commitdiff
Do not keep DSM measure in cache
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 15 Dec 2010 06:52:12 +0000 (06:52 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 15 Dec 2010 06:52:12 +0000 (06:52 +0000)
plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java

index 30c994c38964c3aee515e809afc41f5d741a3279..ef98f42a7690abfa892e5c9a148114cbe4d34e60 100644 (file)
  */
 package org.sonar.plugins.squid.bridges;
 
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.SensorContext;
@@ -30,21 +26,21 @@ import org.sonar.api.design.Dependency;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.Measure;
 import org.sonar.api.measures.Metric;
+import org.sonar.api.measures.PersistenceMode;
 import org.sonar.api.resources.Project;
 import org.sonar.api.resources.Resource;
 import org.sonar.api.utils.TimeProfiler;
-import org.sonar.graph.Cycle;
-import org.sonar.graph.Dsm;
-import org.sonar.graph.DsmTopologicalSorter;
-import org.sonar.graph.Edge;
-import org.sonar.graph.IncrementalCyclesAndFESSolver;
-import org.sonar.graph.MinimumFeedbackEdgeSetSolver;
+import org.sonar.graph.*;
 import org.sonar.squid.Squid;
 import org.sonar.squid.api.SourceCode;
 import org.sonar.squid.api.SourceCodeEdge;
 import org.sonar.squid.api.SourcePackage;
 import org.sonar.squid.api.SourceProject;
 
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
 public class DesignBridge extends Bridge {
 
   private static final Logger LOG = LoggerFactory.getLogger(DesignBridge.class);
@@ -80,7 +76,8 @@ public class DesignBridge extends Bridge {
       savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_EDGES_WEIGHT, getEdgesWeight(squidPackages), false);
 
       String dsmJson = serializeDsm(squid, squidPackages, feedbackEdges);
-      context.saveMeasure(sonarProject, new Measure(CoreMetrics.DEPENDENCY_MATRIX, dsmJson));
+      Measure dsmMeasure = new Measure(CoreMetrics.DEPENDENCY_MATRIX, dsmJson).setPersistenceMode(PersistenceMode.DATABASE);
+      context.saveMeasure(sonarProject, dsmMeasure);
 
       profiler.stop();
     }