All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.pitest.pitest_source_tab.rb Maven / Gradle / Ivy

There is a newer version: 0.5
Show newest version


<% ["pitest_mutations_total", "pitest_mutations_detected", "pitest_mutations_noCoverage", "pitest_mutations_killed", "pitest_mutations_survived", "pitest_mutations_memoryError", "pitest_mutations_timedOut", "pitest_mutations_unknown"].each do |metric_name| %> <% end %>
<%= format_measure(measure('pitest_mutations_coverage')) %>
<%= metric(metric_name).short_name%>:
<%= format_measure(measure(metric_name)) %>
<% def getMutantStyle(mutant) styleStatusMap = { "KILLED" => "mutationkilled", "MEMORY_ERROR" => "mutationkilled", "TIMED_OUT" => "mutationkilled", "NO_COVERAGE" => "mutationnocoverage", "UNKNOWN" => "mutationnocoverage", "SURVIVED" => "mutationsurvived" } return styleStatusMap[mutant["s"]] end def countMutantsByStatus(mutants, *status) result = 0; mutants.each do |mutant| if status.include?(mutant["s"]) result = result +1 end end return result end data = JSON.parse measure('pitest_mutations_data').data [email protected]_highlighted_lines() source_lines.each_with_index do |line, index| mutants = data[(index+1).to_s] survivedMutants = 0; notCoveredMutants = 0; style = ""; displayedIndex = (index+1).to_s unless mutants.nil? survivedMutants = countMutantsByStatus(mutants, "SURVIVED") notCoveredMutants = countMutantsByStatus(mutants, "NO_COVERAGE", "UNKNOWN") if survivedMutants > 0 style = "red" elsif notCoveredMutants > 0 style = "orange" else style = "green" end end %> <% unless mutants.nil? %> <% end %> <% end %>
"><%= displayedIndex %>
<%= mutants.nil? ? " " : mutants.length.to_s %>
<%= mutants.nil? ? " " : survivedMutants.to_s + "/" + notCoveredMutants.to_s %>
<%= line%>
<% mutants.each do |mutant| %>
<%= mutant["s"] %>  Sep12  <%= mutant["mname"] %>
<%= mutant["mdesc"] %>
  <% end %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy