Branch Coverage

blib/lib/Geo/TCX.pm
Criterion Covered Total %
branch 145 198 73.2


line true false branch
60 5 18 if (ref $first_arg eq 'SCALAR') { }
63 0 18 unless -f $first_arg
70 17 6 if $txt =~ s[(<Creator.*</Creator>)][]
75 23 0 if $txt =~ /(<.xml version[^>]*>)/
76 23 0 if $txt =~ m[(<TrainingCenterDatabase.*</TrainingCenterDatabase>)]
77 13 10 if $txt =~ m[(<Activities.*</Activities>)]
78 13 10 if $txt =~ m[(<Activity.*</Activity>)]
79 10 13 if $txt =~ m[(<Courses.*</Courses>)]
80 10 13 if $txt =~ m[(<Course(?!s).*</Course>)]
83 13 10 if ($o->{'tag_activity'})
84 13 0 if $o->{'tag_activity'} =~ m[<Activity.*<Id>(.*)</Id>]
85 13 0 if $o->{'tag_activity'} =~ /<Activity Sport="([^"]+)"/
89 10 13 if ($o->{'tag_course'})
91 10 0 if $o->{'tag_course'} =~ m[<Course.*<Name>(.*)</Name>]
94 17 6 if $txt =~ m[(<Author.*</Author>)]
95 17 6 if $o->{'tag_author'}
98 13 10 if ($o->{'tag_activity'})
104 32 13 if $i > 0
109 10 13 if ($o->{'tag_course'})
116 10 0 if ($xml_str =~ m[(<Lap>.*</Lap>)]s)
119 0 10 if (@lap_tags == 0)
124 10 0 if ($lap_tags[$i] =~ m[<EndPosition>(.*)</EndPosition>]s)
135 10 0 if ($xml_str =~ m[(<Track>.*</Track>)]s)
140 10 0 if (@lap_tags == 1) { }
144 0 0 if ($i < $#lap_tags) { }
156 0 10 if $i > 0
163 0 23 unless $n
164 12 11 $n > 1 ? :
192 0 2 if $clone->is_course
196 1 1 $opts{'lap'} ? :
201 2 2 if (defined $course) { }
224 0 6 if $@
242 0 53 if not $lap_i or @_
259 95 2 unless @_
283 0 1 if not $i2 or @_
284 0 1 unless $i2 - $i1 == 1
306 0 3 if not $pt_no or @_
325 0 1 if @_
327 1 0 unless ref $to_pt
382 0 5 unless $lap_i
423 5 4 if (ref $_[0] eq 'ARRAY') { }
432 6 3 if $o->is_course or $opts{'course'}
434 0 9 unless $fname
445 6 3 if ($as_course) { }
447 6 0 if (@laps_to_save == 1) { }
449 4 2 if (defined $opts{'course_name'}) { }
451 2 0 if ($o->is_course) { }
477 10 5 unless ($opts{'nosave'})
479 0 10 if -f $fname_lap and not $opts{'force'}
480 0 10 unless open my $fh, ">", $fname_lap
509 1 1 if ($opts{'filename'}) { }
511 0 2 unless $fname
512 0 2 if -f $fname and not $opts{'force'}
516 2 0 if ($o->is_course) { }
523 4 0 if ($lap->is_course) { }
527 4 0 if ($str_lap =~ s[\s*(<Lap>.*</Lap>)\s*(<Track>.*</Track>)\s*][]s) { }
537 2 0 if $str_course_tracks
539 2 0 if ($o->is_course) { }
544 0 2 unless open my $fh, ">", $fname
554 2 9 $opts{'indent'} ? :
555 2 9 $opts{'indent'} ? :
556 8 3 if $o->is_course or $opts{'course'}
571 11 0 if ($o->{'tag_trainingcenterdatabase'} =~ /(<TrainingCenterDatabase[^>]*>)/) { }
581 7 4 if ($o->{'tag_activities'})
582 7 0 if ($o->{'tag_activities'} =~ /(<Activities[^>]*>)/) { }
585 7 0 if ($o->{'tag_activity'} =~ /(<Activity[^>]*>)/) { }
590 4 7 if ($o->{'tag_courses'})
591 4 0 if ($o->{'tag_courses'} =~ /(<Courses[^>]*>)/) { }
594 4 0 if ($o->{'tag_course'} =~ /(<Course(?!s)[^>]*>)/) { }
599 4 7 if ($as_course and not $o->{'tag_courses'})
615 9 2 if $o->{'tag_creator'}
618 9 2 if $o->{'tag_author'}
636 32 28 unless $fname
637 0 28 if @_
639 10 18 if ($o->_is_wd_defined)
644 10 18 if ($wd)
645 8 2 unless ($fname =~ m[^/])
652 0 28 unless -d $o->{'_fileABSOLUTEPATH'}
675 0 83 if @_
678 44 39 if (not $dir) { }
679 28 16 unless $first_call
681 15 1 if ($fname) { }
687 0 39 if $dir =~ /^~/
688 5 34 if $dir eq "-"
690 8 31 if ($dir =~ m[^[^/]])
691 2 6 $first_call ? :
696 0 39 unless -d $dir
698 23 16 if ($first_call) { }
710 39 5 if $dir
744 2 4 if ($activity)
748 4 0 if $o->{'tag_activity'} =~ /<Activity Sport="([^"]*)"/
797 17 0 if ($o->{'tag_author'} =~ m[<Author\s+([^=]+="[^"]+")>(.*)<\/Author>])
802 64 4 if $author_xml =~ m[<$key>(.+)</$key>]
814 0 8 if defined $href->{'key'}
823 0 1 unless %keys_values or $href
824 2 1 if (%keys_values)
826 0 2 unless $possible_author_keys{$key}
838 6 60 if $lap_i < 0
840 0 66 unless $exists{$lap_i}