Sha256: d39c21c75dedb0ca93eb854c1065ce99a768341c26bc5e982b3decb752ffbd94

Contents?: true

Size: 1.68 KB

Versions: 5

Compression:

Stored size: 1.68 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

require Arachni::Options.instance.dir['reports'] + '/xml/buffer.rb'

module Reports

class XML
module PluginFormatters

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

        include Arachni::Reports::Buffer

        def run
            start_tag( 'uniformity' )
            simple_tag( 'description', @description )
            start_tag( 'results' )

            uniformals = @results['uniformals']
            pages      = @results['pages']

            uniformals.each_pair {
                |id, uniformal|

                start_uniformals( id )

                uniformal['hashes'].each_with_index {
                    |hash, i|
                    add_uniformal( i, uniformal )
                }

                end_tag( 'uniformals' )
            }

            end_tag( 'results' )
            end_tag( 'uniformity' )
        end

        def add_uniformal( idx, uniformal )
            __buffer( "<issue index=\"#{uniformal['indices'][idx]}\"" +
                " hash=\"#{uniformal['hashes'][idx]}\" />" )
        end

        def start_uniformals( id )
            __buffer( "<uniformals id=\"#{id}\">" )
        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/xml/uniformity.rb
arachni-0.4.0.3 reports/plugin_formatters/xml/uniformity.rb
arachni-0.4.0.2 reports/plugin_formatters/xml/uniformity.rb
arachni-0.4.0.1 reports/plugin_formatters/xml/uniformity.rb
arachni-0.4 reports/plugin_formatters/xml/uniformity.rb