Sha256: ebb35f5767f736e81fe02c57c5fb5bfd1a1ef0497c90d841c2978a4e516eb3d9

Contents?: true

Size: 1.65 KB

Versions: 5

Compression:

Stored size: 1.65 KB

Contents

=begin
                  Arachni
  Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>

  This is free software; you can copy and distribute and modify
  this program under the term of the GPL v2.0 License
  (See LICENSE file for details)

=end

module Arachni

module Reports

class HTML
module PluginFormatters

    #
    # HTML formatter for the results of the HealthMap plugin
    #
    # @author: Tasos "Zapotek" Laskos
    #                                      <tasos.laskos@gmail.com>
    #                                      <zapotek@segfault.gr>
    # @version: 0.1
    #
    class HealthMap < Arachni::Plugin::Formatter

        def run
            return ERB.new( tpl ).result( binding )
        end

        def tpl
            %q{
                <style type="text/css">
                    a.safe {
                        color: blue
                    }
                    a.unsafe {
                        color: red
                    }
                </style>

                <% @results[:map].each do |entry| %>
                    <% state = entry.keys[0]%>
                    <% url   = entry.values[0]%>

                    <a class="<%=state%>" href="<%=CGI.escapeHTML(url)%>"><%=CGI.escapeHTML(url)%></a> <br/>
                <%end%>

                <br/>

                <h3>Stats</h3>
                <strong>Total</strong>: <%=@results[:total]%> <br/>
                <strong>Safe</strong>: <%=@results[:safe]%> <br/>
                <strong>Unsafe</strong>: <%=@results[:unsafe]%> <br/>
                <strong>Issue percentage</strong>: <%=@results[:issue_percentage]%>%
            }
        end


    end

end
end

end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arachni-0.4.0.4 reports/plugin_formatters/html/healthmap.rb
arachni-0.4.0.3 reports/plugin_formatters/html/healthmap.rb
arachni-0.4.0.2 reports/plugin_formatters/html/healthmap.rb
arachni-0.4.0.1 reports/plugin_formatters/html/healthmap.rb
arachni-0.4 reports/plugin_formatters/html/healthmap.rb