PJVM/Class/Attribute.pm

filter: Statementstmt 93.7% 45 / 48 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 0.0% 0 / 1 totaltotal 92.0% 58 / 63 CC 2 SCAR 1.6
CC
2
Cov
92%
new_from_io
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« PJVM/Class/Attribute/Synthetic.pm ↑ Summary PJVM/Class/ConstantPool/Types.pm »
1 package PJVM::Class::Attribute;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use PJVM::Class::Attribute::Code;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use PJVM::Class::Attribute::ConstantValue;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use PJVM::Class::Attribute::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use PJVM::Class::Attribute::InnerClasses;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use PJVM::Class::Attribute::LineNumberTable;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use PJVM::Class::Attribute::Synthetic;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use PJVM::Class::Attribute::SourceFile;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use PJVM::Class::Attribute::LocalVariableTable;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use PJVM::Class::Attribute::Deprecated;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 {
17 3 my %attribute_class = (
18 Code => "PJVM::Class::Attribute::Code",
19 ConstantValue => "PJVM::Class::Attribute::ConstantValue",
20 Exceptions => "PJVM::Class::Attribute::Exceptions",
21 InnerClasses => "PJVM::Class::Attribute::InnerClasses",
22 LineNumberTable => "PJVM::Class::Attribute::LineNumberTable",
23 Synthetic => "PJVM::Class::Attribute::Synthetic",
24 SourceFile => "PJVM::Class::Attribute::SourceFile",
25 LocalVariableTable => "PJVM::Class::Attribute::LocalVariableTable",
26 Deprecated => "PJVM::Class::Attribute::Deprecated",
27 );
28
29 21 ▶ sub new_from_io {
Subroutine new_from_io: called CC=2 SCAR=7.4
Pod undocumented
30 21 my ($pkg, $io, $cp) = @_;
31
32 21 my $buff;
33
34 21 read $io, $buff, 2;
35 21 my $type_ix = unpack("n", $buff);
36 21 my $type = $cp->get($type_ix)->value;
37  
38 21 read $io, $buff, 4;
39 21 my $length = unpack("N", $buff);
40
41 21 ▶ if (exists $attribute_class{$type}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $attribute_class{$type}) { } 21 0 21
42 21 return $attribute_class{$type}->new_from_io($io, $cp);
43 }
44 else {
45 0 warn "Couldn't find attribute handler for '${type}'";
46 }
47  
48 0 read $io, $buff, $length;
49
50 # Return nothing
51 0 return ();
52 }
53 }
54  
55 3 1;
56 __END__
« PJVM/Class/Attribute/Synthetic.pm ↑ Summary PJVM/Class/ConstantPool/Types.pm »