aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2016-05-13 16:43:05 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2016-05-13 16:46:22 +0200
commita5eaf6e090b00fc1d0813e12b3e33cd2e5e3c792 (patch)
treefa33a42011ed55f8d7be8fde726eda79e88b4e3c
parentf49762d1f718302495b9b56ad521c7ec78c46c9d (diff)
downloadsonarqube-a5eaf6e090b00fc1d0813e12b3e33cd2e5e3c792.tar.gz
sonarqube-a5eaf6e090b00fc1d0813e12b3e33cd2e5e3c792.zip
SONAR-6806 Show component key as tooltip to help identify original source file
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/ResourceReport.java14
-rw-r--r--sonar-scanner-engine/src/main/resources/org/sonar/batch/scan/report/issuesreport.ftl2
2 files changed, 9 insertions, 7 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/ResourceReport.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/ResourceReport.java
index 6267335baf0..c2d14b20c35 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/ResourceReport.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/ResourceReport.java
@@ -19,18 +19,16 @@
*/
package org.sonar.batch.scan.report;
-import org.sonar.batch.issue.tracking.TrackedIssue;
-
-import org.sonar.api.batch.rule.Rule;
import com.google.common.collect.Maps;
-import org.sonar.api.rules.RulePriority;
-import org.sonar.batch.index.BatchComponent;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
+import org.sonar.api.batch.rule.Rule;
+import org.sonar.api.rules.RulePriority;
+import org.sonar.batch.index.BatchComponent;
+import org.sonar.batch.issue.tracking.TrackedIssue;
public final class ResourceReport {
private final BatchComponent resource;
@@ -55,6 +53,10 @@ public final class ResourceReport {
return resource.resource().getName();
}
+ public String getKey() {
+ return resource.inputComponent().key();
+ }
+
public String getType() {
return resource.resource().getScope();
}
diff --git a/sonar-scanner-engine/src/main/resources/org/sonar/batch/scan/report/issuesreport.ftl b/sonar-scanner-engine/src/main/resources/org/sonar/batch/scan/report/issuesreport.ftl
index e027da8cb2f..78a82809274 100644
--- a/sonar-scanner-engine/src/main/resources/org/sonar/batch/scan/report/issuesreport.ftl
+++ b/sonar-scanner-engine/src/main/resources/org/sonar/batch/scan/report/issuesreport.ftl
@@ -293,7 +293,7 @@
<tr class="total">
<th align="left" colspan="2" nowrap>
<div class="file_title">
- <img src="issuesreport_files/${resourceReport.getType()}.png" title="Resource icon"/>
+ <img src="issuesreport_files/${resourceReport.getType()}.png" title="${resourceReport.getKey()}"/>
<a href="#" onclick="$('.resource-details-${resourceReport_index?c}').toggleClass('masked'); return false;" style="color: black">${resourceReport.getName()}</a>
</div>
</th>