C0 code coverage information

Generated on Wed Aug 01 14:04:29 -0300 2007 with rcov 0.8.0


Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
Name Total lines Lines of code Total coverage Code coverage
lib/visitor/javap/method_info.rb 87 66
100.0% 
100.0% 
 1 require 'utils'
 2 
 3 module YAJD
 4 
 5 module Visitor
 6 
 7 module Javap
 8 
 9 class MethodInfoVisitor < Visitor::Base
10 private
11     def header
    def header
    248   lib/visitor/javap/method_info.rb:43 in 'YAJD::Visitor::Javap::MethodInfoVisitor#accept'

12         access = AccessFlags::Method::to_java(@object.access_flags)
        access = AccessFlags::Method::to_java(@object.access_flags)
    248   #<Class:YAJD::AccessFlags::Method>#to_java at lib/access_flags.rb:77

13         access += ' ' unless access.empty?
14         m = MethodDescriptor.new(@object.descriptor.bytes)
        m = MethodDescriptor.new(@object.descriptor.bytes)
    248   YAJD::MethodDescriptor#initialize at lib/method_descriptor.rb:6
    248   YAJD::CommonInfo#descriptor at (eval):2

15         args = "(#{m.args.join(', ')})"
16 
17         method_name = @object.name.bytes
        method_name = @object.name.bytes
    248   YAJD::CommonInfo#name at (eval):2

18         if method_name == '<init>'
19             method_name = @object.parent.name
            method_name = @object.parent.name
     14   YAJD::ConstantPool::CClass#name at lib/constant_pool/cpinfo.rb:98
     14   YAJD::CommonInfo#parent at (eval):2

20         elsif method_name == '<clinit>'
21             method_name = '{}'
22             args = ''
23         else
24             return_type = m.return_type
25             return_type += ' '
26         end
27 
28         throws = dump_exceptions
        throws = dump_exceptions
    248   YAJD::Visitor::Javap::MethodInfoVisitor#dump_exceptions at lib/visitor/javap/method_info.rb:33

29 
30         "#{access}#{return_type}#{method_name}#{args}#{throws}"
31     end
32 
33     def dump_exceptions
    def dump_exceptions
    248   lib/visitor/javap/method_info.rb:28 in 'YAJD::Visitor::Javap::MethodInfoVisitor#header'

34         #TODO almost the same code at CodeInfoVisitor
35         exceptions = @object.exceptions
        exceptions = @object.exceptions
    248   YAJD::MethodInfo#exceptions at lib/common.rb:55

36         unless exceptions.nil?
37             exceptions = exceptions.exceptions
38             '   throws ' + exceptions.map { |e| e.name }.join(', ')
            '   throws ' + exceptions.map { |e| e.name }.join(', ')
    226   YAJD::ConstantPool::CClass#name at lib/constant_pool/cpinfo.rb:98

39         end
40     end
41 public
42     def accept(visitor)
    def accept(visitor)
    248   lib/visitor/javap.rb:29 in 'YAJD::Visitor::Javap::JavapVisitor#visit'

43         result = header
        result = header
    248   YAJD::Visitor::Javap::MethodInfoVisitor#header at lib/visitor/javap/method_info.rb:11

44 
45         YAJD::logger.debug { result }
        YAJD::logger.debug { result }
    248   Logger#debug at /usr/lib/ruby/1.8/logger.rb:347
    248   #<Class:YAJD>#logger at lib/yajd.rb:20

46 
47         result += ';'
48         result = dump_attributes(visitor, result)
        result = dump_attributes(visitor, result)
    248   YAJD::Visitor::Javap::MethodInfoVisitor#dump_attributes at lib/visitor/javap/method_info.rb:55

49 
50         result
51     end
52 
53 protected
54 
55     def dump_attributes(visitor, result)
    def dump_attributes(visitor, result)
    248   lib/visitor/javap/method_info.rb:48 in 'YAJD::Visitor::Javap::MethodInfoVisitor#accept'

56         @object.attributes.each do |a|
57             if a.is_a?(Attributes::CodeInfo)
58                 m = CodeInfoVisitor.new(a).accept(visitor)
                m = CodeInfoVisitor.new(a).accept(visitor)
    248   YAJD::Visitor::Javap::CodeInfoVisitor#accept at lib/visitor/javap/code_info.rb:10
    248   YAJD::Visitor::Base#initialize at lib/visitor/base.rb:6

59                 if m.size > 0
60                     result += "\n"
61                     result += m.join("\n")
62                 end
63             elsif a.is_a?(Attributes::ExceptionsInfo)
64                 result += "\n"
65                 result += "  Exceptions: \n"
66                 #Not adding a \n after the throws makes the following line
67                 #appear in the same line but it's javap behaviour and we are
68                 #mimicking it.
69                 result += '   throws ' + a.exceptions.map { |e| e.name }.join(', ')
                result += '   throws ' + a.exceptions.map { |e| e.name }.join(', ')
    226   YAJD::ConstantPool::CClass#name at lib/constant_pool/cpinfo.rb:98

70             elsif a.is_a?(Attributes::DeprecatedInfo)
71                 result += "  Deprecated: true"
72                 result += "\n"
73             elsif a.is_a?(Attributes::SignatureInfo)
74                 result += "  Signature: length = 0x#{a.attribute_length.to_s(16)}\n"
75                 result += "   #{a.signature}\n"
                result += "   #{a.signature}\n"
      2   YAJD::ConstantPool::CUTF8Info#to_s at lib/constant_pool/strings.rb:45
      2   YAJD::Attributes::SignatureInfo#signature at (eval):2

76             end
77         end
78 
79         result
80     end
81 end
82 
83 end
84 
85 end
86 
87 end

Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.

Valid XHTML 1.0! Valid CSS!