WARC/Index/File/CDX/Entry.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 6 / 6 totaltotal 100% 37 / 37 CC 2 SCAR 2.0
CC
2
Cov
100%
value
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« WARC/Record/Stub.pm ↑ Summary WARC/Builder.pm »
1 package WARC::Index::File::CDX::Entry; # -*- CPerl -*-
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 require WARC::Index::Entry;
7 2 our @ISA = qw(WARC::Index::Entry);
8  
9 2 require WARC; *WARC::Index::File::CDX::Entry::VERSION = \$WARC::VERSION;
10  
11 # This implementation uses a hash as the underlying structure.
12  
13 # Accessible search keys are stored directly in the hash, while internal
14 # values are stored with names with a leading underscore.
15  
16 1 ▶sub index { (shift)->{_index} }
Subroutine index: called CC=1 SCAR=0.0
Pod documented
17 30 ▶sub volume { (shift)->{_g__volume} }
Subroutine volume: called CC=1 SCAR=0.0
Pod documented
18 1 ▶sub entry_position { (shift)->{_entry_offset} }
Subroutine entry_position: called CC=1 SCAR=0.0
Pod documented
19 30 ▶sub record_offset { (shift)->{_Vv__record_offset} }
Subroutine record_offset: called CC=1 SCAR=0.0
Pod documented
20  
21 sub next {
22 13 ▶ my $self = shift;
Subroutine next: called CC=1 SCAR=0.0
Pod documented
23  
24 return $self->{_index}->entry_at($self->{_entry_offset}
25 13 + $self->{_entry_length});
26 }
27  
28 sub value {
29 96 ▶ my $self = shift;
Subroutine value: called CC=2 SCAR=6.9
Pod documented
30 96 my $key = shift;
31  
32 96 ▶ return undef if $key =~ m/^_/;
Branch: 1 branch
BranchTrueFalseTotal
if $key =~ /^_/ 2 94 96
33 94 return $self->{$key};
34 }
35  
36 2 1;
37 __END__
« WARC/Record/Stub.pm ↑ Summary WARC/Builder.pm »