import org.sonar.api.batch.SonarIndex;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.fs.internal.DefaultInputModule;
-import org.sonar.api.batch.measure.MetricFinder;
import org.sonar.api.design.Dependency;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.MeasuresFilter;
private Map<Resource, Bucket> buckets = Maps.newLinkedHashMap();
private DefaultProjectTree projectTree;
- public DefaultIndex(BatchComponentCache componentCache, DefaultProjectTree projectTree, MetricFinder metricFinder, MeasureCache measureCache) {
+ public DefaultIndex(BatchComponentCache componentCache, DefaultProjectTree projectTree, MeasureCache measureCache) {
this.componentCache = componentCache;
this.projectTree = projectTree;
this.measureCache = measureCache;
List<DefaultIssue> trackedIssues;
if (localIssueTracking != null) {
- trackedIssues = localIssueTracking.trackIssues(reader, component, rawIssues);
+ trackedIssues = localIssueTracking.trackIssues(component, rawIssues);
} else {
trackedIssues = Lists.newArrayList();
}
issueCache.put(issue);
}
}
-
+
private void addUnmatchedRawIssues(BatchComponent component, Set<org.sonar.batch.protocol.output.BatchReport.Issue> rawIssues, List<DefaultIssue> trackedIssues) {
for (BatchReport.Issue rawIssue : rawIssues) {
import org.sonar.batch.index.BatchComponent;
import org.sonar.batch.index.BatchComponentCache;
import org.sonar.batch.protocol.output.BatchReport;
-import org.sonar.batch.protocol.output.BatchReportReader;
import org.sonar.batch.report.ReportPublisher;
import org.sonar.batch.repository.ProjectRepositories;
import org.sonar.core.component.ComponentKeys;
}
}
- public List<DefaultIssue> trackIssues(BatchReportReader reader, BatchComponent component, Set<BatchReport.Issue> rawIssues) {
+ public List<DefaultIssue> trackIssues(BatchComponent component, Set<BatchReport.Issue> rawIssues) {
List<DefaultIssue> trackedIssues = Lists.newArrayList();
if (hasServerAnalysis) {
import org.sonar.batch.report.ReportPublisher;
import org.sonar.batch.repository.FileData;
import org.sonar.batch.repository.ProjectRepositories;
-import org.sonar.batch.scan.filesystem.InputPathCache;
public final class ScmSensor implements Sensor {
private final ReportPublisher publishReportJob;
public ScmSensor(ProjectDefinition projectDefinition, ScmConfiguration configuration,
- ProjectRepositories projectRepositories, FileSystem fs, InputPathCache inputPathCache, BatchComponentCache resourceCache,
- ReportPublisher publishReportJob) {
+ ProjectRepositories projectRepositories, FileSystem fs, BatchComponentCache resourceCache, ReportPublisher publishReportJob) {
this.projectDefinition = projectDefinition;
this.configuration = configuration;
this.projectRepositories = projectRepositories;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
-import org.sonar.api.batch.measure.MetricFinder;
-import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.MeasuresFilters;
import org.sonar.api.profiles.RulesProfile;
@Before
public void createIndex() throws IOException {
- MetricFinder metricFinder = mock(MetricFinder.class);
- when(metricFinder.findByKey("ncloc")).thenReturn(CoreMetrics.NCLOC);
ruleFinder = mock(RuleFinder.class);
DefaultProjectTree projectTree = mock(DefaultProjectTree.class);
BatchComponentCache resourceCache = new BatchComponentCache();
- index = new DefaultIndex(resourceCache, projectTree, metricFinder, mock(MeasureCache.class));
+ index = new DefaultIndex(resourceCache, projectTree, mock(MeasureCache.class));
baseDir = temp.newFolder();
project = new Project("project");