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 7 $Git::FastExport::Block::VERSION = '0.108';
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 my $LF = "\012";
7  
8 7 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 352 ▶sub as_string {
Subroutine as_string: called CC=6 SCAR=17.9
Pod documented
21 352 my ($self) = @_;
22 352 my $string = $self->{header} . $LF;
23  
24 352 for my $key ( @{ $fields{ $self->{type} } } ) {
25 2001 ▶ next if !exists $self->{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{$key} 328 1673 2001
26 1673 ▶ if ( $key eq 'data' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq 'data') { } 286 1387 1673
27 $string
28 286 .= 'data ' . length( $self->{data} ) . $LF . $self->{data};
29 }
30 else {
31 1387 $string .= "$_$LF" for @{ $self->{$key} };
32 }
33 }
34 352 ▶ return $string .= $self->{footer} || '';
Condition100%2/2
$self->{'footer'} || ''
l!l
28765
MC/DC100%1/1
$self->{'footer'} || ''
$self->{'footer'}
Truth table100%2/2
A
A= $self->{'footer'}
Aresult
11
00
35 }
36  
37 7 'progress 1 objects';
38  
39 __END__
« FastExport.pm ↑ Summary