PurePerl/NewObject/Tree.pm

filter: Statementstmt 76.1% 16 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 76.9% 20 / 26 CC 2 SCAR 9.8
CC
2
Cov
76%
_build_content
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« PurePerl/Loose.pm ↑ Summary PurePerl/NewObject/Commit.pm »
1 package Git::PurePerl::NewObject::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::NewObject';
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::NewDirectoryEntry]',
14 required => 1,
15 auto_deref => 1,
16 );
17  
18 sub _build_content {
19 0 ▶ my $self = shift;
Subroutine _build_content: not called CC=2 SCAR=17.9
20 0 my $content;
21 0 foreach my $de ( $self->directory_entries ) {
22 0 $content
23 .= $de->mode . ' '
24 . $de->filename . "\0"
25 . pack( 'H*', $de->sha1 );
26 }
27 0 $self->content($content);
28 }
29  
30 4 __PACKAGE__->meta->make_immutable;
31  
« PurePerl/Loose.pm ↑ Summary PurePerl/NewObject/Commit.pm »