Gitalist/Object/HasTree.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 40.0% 16 / 40 CC 6 SCAR 24.4
CC
6
Cov
35%
_build_tree
22.9
entries
3.5
BEGIN
1.3
CRAP 11.5
« Gitalist/Repository.pm ↑ Summary Gitalist/Object.pm »
1 package Git::Gitalist::Object::HasTree;
2  
3 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 has tree => (
8 isa => 'ArrayRef[Git::Gitalist::Object]',
9 required => 0,
10 is => 'ro',
11 lazy_build => 1,
12 );
13  
14  
15 0 ▶method _build_tree {
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine _build_tree: not called CC=5 SCAR=31.3
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
16 0 my $output = $self->_run_cmd(qw/ls-tree -z/, $self->sha1);
17 0 ▶ return unless defined $output;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $output 0 0 0
18  
19 0 my @ret;
20 0 for my $line (split /\0/, $output) {
21 0 my ($mode, $type, $object, $file) = split /\s+/, $line, 4;
22 # Ignore commits, these represent submodules
23 0 ▶ next if $type eq 'commit';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "commit" 0 0 0
24 0 my $class = 'Git::Gitalist::Object::' . ucfirst($type);
25 0 push @ret, $class->new( mode => oct $mode,
26 type => $type,
27 sha1 => $object,
28 file => $file,
29 repository => $self->repository,
30 );
31 }
32 0 return \@ret;
33 }
34  
35 0 ▶method entries {
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine entries: not called CC=2 SCAR=12.4
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
36 0 return $self->{_gpp_obj}->{directory_entries};
37 }
38  
39 2 1;
40  
41 __END__
« Gitalist/Repository.pm ↑ Summary Gitalist/Object.pm »