FastExport/Block.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 31 / 31 CC 6 SCAR 15.6
CC
6
Cov
100%
as_string
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.8
« FastExport.pm ↑ Summary
1 package Git::FastExport::Block;
2 8 $Git::FastExport::Block::VERSION = '0.106';
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 my $LF = "\012";
7  
8 8 my %fields = (
9 commit => [qw( mark author committer data from merge files )],
10 tag => [qw( from tagger data )],
11 reset => [qw( from )],
12 blob => [qw( mark data )],
13 checkpoint => [],
14 progress => [],
15 feature => [],
16 option => [],
17 done => [],
18 );
19  
20 sub as_string {
21 546 ▶ my ($self) = @_;
Subroutine as_string: called CC=6 SCAR=17.9
Pod documented
22 546 my $string = $self->{header} . $LF;
23  
24 546 for my $key ( @{ $fields{ $self->{type} } } ) {
25 2323 ▶ next if !exists $self->{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{$key} 308 2015 2323
26 2015 ▶ if ( $key eq 'data' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq 'data') { } 484 1531 2015
27 $string
28 484 .= 'data ' . length( $self->{data} ) . $LF . $self->{data};
29 }
30 else {
31 1531 $string .= "$_$LF" for @{ $self->{$key} };
32 }
33 }
34 546 ▶ return $string .= $self->{footer} || '';
Condition100%2/2
$self->{'footer'} || ''
l!l
48561
MC/DC100%1/1
$self->{'footer'} || ''
$self->{'footer'}
Truth table100%2/2
A
A= $self->{'footer'}
Aresult
11
00
35 }
36  
37 8 'progress 1 objects';
38  
39 __END__
« FastExport.pm ↑ Summary