org.sonar.plugins.sigmm.mm_widget.erb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-sigmm-plugin Show documentation
Show all versions of sonar-sigmm-plugin Show documentation
Implementation of the SIG Maintainability Model
The newest version!
<%
if measure('sigmm-maintainability')
def self.format(ms)
mapping = {'0.0' => '--', '1.0' => '-', '2.0' => '0', '3.0' => '+', '4.0' => '++'};
mapping[shift_measure(ms)];
end
def self.shift_measure(ms)
(measure(ms).value + 2).to_s;
end
def self.color(ms)
color_mapping = {'++' => '00ff00', '+' => '7fff00', '0' => 'ffff00', '-' => 'ff7f00', '--' => 'ff0000'};
color_mapping[format(ms)];
end
a = 'sigmm-analysability';
c = 'sigmm-changeability';
s = 'sigmm-stability';
t = 'sigmm-testability';
m = 'sigmm-maintainability';
%>
SIG Maintain. Model
<%= image_tag 'help.png', :class => 'png' -%>
(A)nalysability
<%= format(a) -%>
(C)hangeability
<%= format(c) -%>
(S)tability
<%= format(s) -%>
(T)estability
<%= format(t) -%>
<%=
chart('ck=xradar&w=120&h=120&c=' + color(m) + '|' + color(m) + '&m=4&g=0.2&l=A,C,S,T&v=' + shift_measure(a) + ',' + shift_measure(c) + ',' + shift_measure(s) + ',' + shift_measure(t)) -%>
<%
end
%>