| 1 | package File::Version; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use integer; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | require Exporter; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | our @EXPORT = qw(); # nothing to export, this is OO | |||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | # file-private functions | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my $recursive_find = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | my $regex = shift; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my($loc_recursive, $rec_depth, @matches); | |||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | $loc_recursive = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $path = shift; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | return if $self->{RECURSION_DEPTH} && (scalar @$path > $rec_depth); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"RECURSION_DEPTH"} and scalar @$path > $rec_depth
MC/DC0%0/2
$self->{"RECURSION_DEPTH"} and scalar @$path > $rec_depth
$self->{"RECURSION_DEPTH"}
scalar @$path > $rec_depth
Truth table0%0/3
A and B
A= $self->{"RECURSION_DEPTH"}B= scalar @$path > $rec_depth
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $str_path = join('/', @$path); | |||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | substr($str_path, 0, 0) = '/' unless $str_path =~ /^\.+\/?/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | opendir(PH, $str_path); | |||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | my @files = grep(!/^\.\.?$/, readdir(PH)); | |||||||||||||||||||||||||||||||||||||||||
| 27 | #weed out symbolic links unless FOLLOW_SYMBOLIC is true | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | @files = grep( !( -l $_ ), @files) unless $self->{FOLLOW_SYMBOLIC}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | closedir(PH); | |||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | for(@files) { | |||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | my @temp = @$path; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | push(@temp, $_); | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | my $string_loc = join('/', @temp); | |||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | substr($string_loc, 0, 0) = '/' unless $string_loc =~ /^\.+\/?/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | next unless (-r $string_loc); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | if( -f $string_loc && /$regex/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-f $string_loc and /$regex/
MC/DC0%0/2
-f $string_loc and /$regex/
-f $string_loc
/$regex/
Truth table0%0/3
A and B
A= -f $string_locB= /$regex/
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | push(@matches, $string_loc); | |||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | if( -d $string_loc ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | &$loc_recursive(\@temp); | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | for(@ { $self->{SEARCH_PATHS} }) { | |||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | my @dir_parts = grep(/./, split '/'); | |||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | $rec_depth = ($self->{RECURSION_DEPTH} + scalar @dir_parts); | |||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | &$loc_recursive([ @dir_parts ]); | |||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | @matches ? return \@matches : return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | # constructor | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=20 SCAR=60.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | my $invocant = shift; | |||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | my $class = ref($invocant) || $invocant; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $invocant || $invocant
MC/DC0%0/2
ref $invocant || $invocant
ref $invocant
$invocant
Truth table0%0/3
A || B
A= ref $invocantB= $invocant
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my $self = { SEARCH_PATHS => [ qw(.) ], # search current directory | |||||||||||||||||||||||||||||||||||||||||
| 60 | RECURSION_DEPTH => 0, | ||||||||||||||||||||||||||||||||||||||||||
| 61 | FOLLOW_SYMBOLIC => 0, # default: don't follow symlinks | ||||||||||||||||||||||||||||||||||||||||||
| 62 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 63 | # validate user supplied arguments | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | croak( "Invalid file" ) unless( $args{FILE} && -f $args{FILE} && -r _); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$args{"FILE"} and -f $args{"FILE"} and -r _
$args{"FILE"} and -f $args{"FILE"}
MC/DC0%0/3
$args{"FILE"} and -f $args{"FILE"} and -r _
$args{"FILE"}
-f $args{"FILE"}
-r _
Truth table0%0/4
A and B and C
A= $args{"FILE"}B= -f $args{"FILE"}C= -r _
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if($args{FILE} =~ /^(.*\/)?((?:\d+_)+?)(?:0_)*_(.+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | $self->{FILE} = $3 or croak( "Invalid file.\n" ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | $self->{VERSION} = $2 || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$2 || ''
MC/DC0%0/1
$2 || ''
$2
Truth table0%0/2
A
A= $2
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | elsif($args{FILE} =~ /^(.*\/)?(.+)$/) { | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | $self->{FILE} = $2 or croak( "Invalid file.\n" ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | $self->{VERSION} = ''; | |||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | else { croak( "Invalid file" ) }; | |||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | $self->{FILE_PATH} = $1 if $1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | $self->{WHOLE} = $& or croak( "Invalid file.\n" ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | if ( $args{SEARCH_PATHS} && @{ $args{SEARCH_PATHS} }) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$args{"SEARCH_PATHS"} and @{$args{"SEARCH_PATHS"};}
MC/DC0%0/2
$args{"SEARCH_PATHS"} and @{$args{"SEARCH_PATHS"};}
$args{"SEARCH_PATHS"}
@{$args{"SEARCH_PATHS"};}
Truth table0%0/3
A and B
A= $args{"SEARCH_PATHS"}B= @{$args{"SEARCH_PATHS"};}
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | for(@{ $args{SEARCH_PATHS} }) { | |||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | if( -d && -r) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $_ and -r $_
MC/DC0%0/2
-d $_ and -r $_
-d $_
-r $_
Truth table0%0/3
A and B
A= -d $_B= -r $_
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | push @{ $self->{SEARCH_PATHS} }, $_; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | carp ( "Directory does not exist: $_\n"); | |||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | if ($args{RECURSION_DEPTH}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | croak ( "Invalid RECURSION_DEPTH: $args{RECURSION_DEPTH}\n") | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | unless $args{RECURSION_DEPTH} =~ /^[+]?\d+$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | $self->{RECURSION_DEPTH} = $args{RECURSION_DEPTH}; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | $self->{FOLLOW_SYMBOLIC} = $args{FOLLOW_SYMBOLIC} ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | # OO functions | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | sub recursion_depth { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recursion_depth: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | if(@_) { $self->{RECURSION_DEPTH} = shift } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | return $self->{RECURSION_DEPTH}; | |||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | sub follow_symbolic { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
follow_symbolic: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | $self->{FOLLOW_SYMBOLIC} = $args{FOLLOW_SYMBOLIC} ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | return $self->{FOLLOW_SYMBOLIC}; | |||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | sub search_paths { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_paths: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | if (@{ $args{SEARCH_PATHS} }) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | for(@{ $args{SEARCH_PATHS} }) { | |||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | if( -d && -r) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $_ and -r $_
MC/DC0%0/2
-d $_ and -r $_
-d $_
-r $_
Truth table0%0/3
A and B
A= -d $_B= -r $_
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | push @{ $self->{SEARCH_PATHS} }, $_; | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | carp ( "SEARCH_PATHS not set: $_\n"); | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | else { carp ( "SEARCH_PATHS not set.\n"); } | |||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | return $self->{SEARCH_PATHS}; | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | sub locate_ancestors { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
locate_ancestors: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | my @gens; | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | @gens = split('_', $self->{VERSION}); | |||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | my $gen_count = 0; | |||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | while(@gens) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | my $match; | |||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $regex = join('_', @gens) . "_(?:0_)*_$self->{FILE}"; | |||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | $regex = eval { qr/$regex/ } || croak "Invalid pattern.\n"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
eval {
do {
qr/$regex/
}
} || croak("Invalid pattern.\n")
MC/DC0%0/1
eval {
do {
qr/$regex/
}
} || croak("Invalid pattern.\n")
eval {
do {
qr/$regex/
}
}
Truth table0%0/2
A
A= eval {
do {
qr/$regex/
}
}
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | ($match = &$recursive_find($self, $regex)) && do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | for(@$match) { $self->{ANCESTORS}{$gen_count}{$_}++; } | |||||||||||||||||||||||||||||||||||||||||
| 141 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | $gen_count++; | |||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | pop(@gens); | |||||||||||||||||||||||||||||||||||||||||
| 144 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | return $self->{ANCESTORS}; | |||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | sub locate_descendants { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
locate_descendants: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | my $match; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | my $regex = eval { qr/^$self->{VERSION}(?:\d+_)+?(?:0_)*_$self->{FILE}/ } | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
eval {
do {
qr/^$self->{'VERSION'}(?:\d+_)+?(?:0_)*_$self->{'FILE'}/
}
} || croak("Invalid pattern.\n")
MC/DC0%0/1
eval {
do {
qr/^$self->{'VERSION'}(?:\d+_)+?(?:0_)*_$self->{'FILE'}/
}
} || croak("Invalid pattern.\n")
eval {
do {
qr/^$self->{'VERSION'}(?:\d+_)+?(?:0_)*_$self->{'FILE'}/
}
}
Truth table0%0/2
A
A= eval {
do {
qr/^$self->{'VERSION'}(?:\d+_)+?(?:0_)*_$self->{'FILE'}/
}
}
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | || croak "Invalid pattern.\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | ($match = &$recursive_find($self, $regex)) && do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | for(@$match) { | |||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if( my($gen) = /$self->{VERSION}((\d+_)+?)(?:0_)*_/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | my $count = ($gen =~ tr/\_//); | |||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | (my $last = $+) =~ s/\D//g if $+; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | $self->{DESCENDANTS}{$count}{$_} = $last || 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$last || 0
MC/DC0%0/1
$last || 0
$last
Truth table0%0/2
A
A= $last
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | return $self->{DESCENDANTS}; | |||||||||||||||||||||||||||||||||||||||||
| 163 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | sub next_version { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next_version: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | my $high = 0; | |||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | &locate_descendants($self) unless $self->{DESCENDANTS}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | $self->{DESCENDANTS} && do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | for(keys(% { $self->{DESCENDANTS}{1} } )) { | |||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | $high = $self->{DESCENDANTS}{1}{$_} if $high < $self->{DESCENDANTS}{1}{$_}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||
| 173 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | $self->{NEXT_VERSION} = $self->{VERSION} . ++$high . "__$self->{FILE}"; | |||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | return $self->{NEXT_VERSION}; | |||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 179 | __END__ | ||||||||||||||||||||||||||||||||||||||||||