aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-core-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-03-02 14:29:16 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-03-02 14:41:44 +0100
commit6f4488154742041dc531f83ad45e487dbc2fe6d7 (patch)
tree8b22dd62057c16bf93e5947ff9dd9813feb7b97d /plugins/sonar-core-plugin
parent32de25202356fdb88963f02e3fde0ec133bf85c7 (diff)
downloadsonarqube-6f4488154742041dc531f83ad45e487dbc2fe6d7.tar.gz
sonarqube-6f4488154742041dc531f83ad45e487dbc2fe6d7.zip
SONAR-5077 Display ncloc of files with no language in size widget
Diffstat (limited to 'plugins/sonar-core-plugin')
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
index 0a28f86c05c..9e0797f8005 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
@@ -49,8 +49,12 @@
%>
<tr>
<td>
- <% language = languages.find { |l| l.getKey()==language_key.to_s } -%>
- <%= language ? language.getName() : language_key -%>
+ <% if language_key.eql? '<null>' %>
+ <%= message('other') -%>
+ <% else %>
+ <% language = languages.find { |l| l.getKey()==language_key.to_s } -%>
+ <%= language ? language.getName() : language_key -%>
+ <% end %>
</td>
<td class="thin right nowrap">
<%= ncloc.format_numeric_value(language_ncloc) %>
@@ -73,11 +77,14 @@
});
</script>
<% else %>
- <%
+ <%
language_key = ncloc_language_dist_hash.first[0]
- language = languages.find { |l| l.getKey()==language_key.to_s }
- -%>
- <%= language ? language.getName() : language_key -%>
+ if language_key.eql? '<null>' %>
+ <%= message('other') -%>
+ <% else %>
+ <% language = languages.find { |l| l.getKey()==language_key.to_s } -%>
+ <%= language ? language.getName() : language_key -%>
+ <% end %>
<% end %>
<% end %>
<% else %>