PurePerl/Object/Tree.pm

filter: Statementstmt 51.6% 16 / 31 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 48.7% 20 / 41 CC 3 SCAR 17.4
CC
3
Cov
46%
BUILD
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« PurePerl/PackIndex.pm ↑ Summary PurePerl/Protocol/Git.pm »
1 package Git::PurePerl::Object::Tree;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 extends 'Git::PurePerl::Object';
8  
9 4 has 'kind' =>
10 ( is => 'ro', isa => 'ObjectKind', required => 1, default => 'tree' );
11 4 has 'directory_entries' => (
12 is => 'rw',
13 isa => 'ArrayRef[Git::PurePerl::DirectoryEntry]',
14 required => 0,
15 auto_deref => 1,
16 );
17  
18 sub BUILD {
19 0 ▶ my $self = shift;
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod undocumented
20 0 my $content = $self->content;
21 0 ▶ return unless $content;
Branch: 1 branch
BranchTrueFalseTotal
unless $content 0 0 0
22 0 my @directory_entries;
23 0 ▶ while ($content) {
Branch: 1 branch
BranchTrueFalseTotal
if ($content) 0 0 0
24 0 my $space_index = index( $content, ' ' );
25 0 my $mode = substr( $content, 0, $space_index );
26 0 $content = substr( $content, $space_index + 1 );
27 0 my $null_index = index( $content, "\0" );
28 0 my $filename = substr( $content, 0, $null_index );
29 0 $content = substr( $content, $null_index + 1 );
30 0 my $sha1 = unpack( 'H*', substr( $content, 0, 20 ) );
31 0 $content = substr( $content, 20 );
32 0 push @directory_entries,
33 Git::PurePerl::DirectoryEntry->new(
34 mode => $mode,
35 filename => $filename,
36 sha1 => $sha1,
37 git => $self->git,
38 );
39 }
40 0 $self->directory_entries( \@directory_entries );
41 }
42  
43 4 __PACKAGE__->meta->make_immutable;
44  
« PurePerl/PackIndex.pm ↑ Summary PurePerl/Protocol/Git.pm »