Branch Coverage

blib/lib/Map/Metro/Graph.pm
Criterion Covered Total %
branch 76 294 25.8


line true false branch
186 0 0 @_ ? :
197 0 0 @_ ? :
201 1 0 @_ ? :
208 1 0 @_ ? :
214 5 44 if not length $row or $row =~ /^[ \t]*#/u
216 3 41 if ($row =~ /^--(\w+)/u and &any(sub { $_ eq $1; } , 'stations', 'transfers', 'lines', 'segments'))
221 19 0 $context eq 'segments' ? :
2 19 $context eq 'lines' ? :
0 21 $context eq 'transfers' ? :
20 21 $context eq 'stations' ? :
230 20 0 @_ ? :
20 0 @_ ? :
0 20 if @_ != 1
20 0 $#_ >= 0 ? :
20 0 Type::Tiny::XS::Str($text) ? :
20 0 if ($#_ >= 0)
235 0 20 if (my $station = $self->get_station_by_name($name, 'check', 0))
243 0 0 if ($another_name =~ /^:(.+)/u) { }
254 0 0 @_ ? :
0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::Str($text) ? :
0 0 if ($#_ >= 0)
261 0 0 defined $option_string ? :
270 2 0 @_ ? :
2 0 @_ ? :
0 2 if @_ != 1
2 0 $#_ >= 0 ? :
2 0 Type::Tiny::XS::Str($text) ? :
2 0 if ($#_ >= 0)
274 0 2 defined $option_string ? :
280 19 0 @_ ? :
19 0 @_ ? :
0 19 if @_ != 1
19 0 $#_ >= 0 ? :
19 0 Type::Tiny::XS::Str($text) ? :
19 0 if ($#_ >= 0)
286 0 19 defined $option_string ? :
298 0 0 $error->does('Map::Metro::Exception') ? :
306 24 0 if ($line_info =~ /^[a-z0-9]+$/iu) { }
0 0 elsif ($line_info =~ /^([a-z0-9]+)->$/iu) { }
0 0 elsif ($line_info =~ /^([a-z0-9]+)<-$/iu) { }
317 19 0 if (scalar @both_dir)
320 0 19 if (scalar @forward)
323 0 19 if (scalar @backward)
330 48 0 @_ ? :
48 0 @_ ? :
0 48 if @_ != 1
48 0 $#_ >= 0 ? :
332 22 26 if $exists
338 48 0 @_ ? :
0 48 if @_ != 1
48 0 $#_ >= 0 ? :
48 0 Type::Tiny::XS::Str($line_id) ? :
48 0 if ($#_ >= 0)
342 58 0 @_ ? :
0 58 if @_ < 1
58 0 $#_ >= 0 ? :
58 0 Type::Tiny::XS::Str($station_name) ? :
58 0 if ($#_ >= 0)
0 58 $#_ == 1 && ref $_[1] eq 'HASH' ? :
20 38 exists $_{'check'} ? :
344 38 20 if &Station()->check($station)
346 0 20 if ($check)
348 0 0 if &Station()->check($station)
352 0 0 if (&any(sub { fc $station_name eq fc $_; } , $current_station->all_alternative_names))
356 0 0 if &Station()->check($station)
360 0 0 if (&any(sub { fc $station_name eq fc $_; } , $current_station->all_search_names))
364 0 0 if &Station()->check($station)
367 0 20 if $check
369 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 defined $id && $id =~ /\A-?[0-9]+\z/u ? :
0 0 if ($#_ >= 0)
373 20 0 @_ ? :
0 20 if @_ != 1
20 0 $#_ >= 0 ? :
20 0 Type::Tiny::XS::AUTO::TC8($station) ? :
20 0 if ($#_ >= 0)
376 96 0 @_ ? :
0 96 if @_ != 2
96 0 $#_ >= 0 ? :
96 0 $#_ >= 1 ? :
377 624 606 if $_->line->id eq $line_id
379 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 defined $line_station_id && $line_station_id =~ /\A-?[0-9]+\z/u ? :
0 0 if ($#_ >= 0)
382 0 0 @_ ? :
0 0 if @_ != 2
0 0 $#_ >= 0 ? :
0 0 defined $first_ls_id && $first_ls_id =~ /\A-?[0-9]+\z/u ? :
0 0 if ($#_ >= 0)
0 0 $#_ >= 1 ? :
0 0 defined $second_ls_id && $second_ls_id =~ /\A-?[0-9]+\z/u ? :
0 0 if ($#_ >= 1)
388 0 0 if $_->origin_line_station->line_station_id == $first_ls->line_station_id
393 0 0 @_ ? :
396 0 0 @_ ? :
0 0 if @_ < 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::Str($string) ? :
0 0 if ($#_ >= 0)
0 0 $#_ == 1 && ref $_[1] eq 'HASH' ? :
0 0 exists $_{'keys'} ? :
0 0 Type::Tiny::XS::AUTO::TC15($keys) ? :
404 0 0 if scalar @$keys and &none(sub { $key eq $_; } , @$keys)
410 1 0 @_ ? :
411 0 1 unless ($self->has_stations and $self->has_lines and $self->has_segments)
457 24 0 unless $segment->is_one_way
460 24 0 unless $segment->is_one_way
477 0 12 $self->has_override_line_change_weight ? :
521 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC21($place) ? :
0 0 if ($#_ >= 0)
523 0 0 if &Station()->check($place)
526 0 0 if (&Int()->check($place)) { }
535 0 0 $error->does('Map::Metro::Exception') ? :
543 0 0 @_ ? :
0 0 if @_ != 2
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC21($origin) ? :
0 0 if ($#_ >= 0)
0 0 $#_ >= 1 ? :
0 0 Type::Tiny::XS::AUTO::TC21($destination) ? :
0 0 if ($#_ >= 1)
551 0 0 if ($self->has_routings)
552 0 0 if $_->origin_station->id == $origin_station->id
553 0 0 if $existing_routing
571 0 0 $self->has_asps ? :
573 0 0 if ($origin->possible_on_same_line($dest) and not $origin->on_same_line($dest))
592 0 0 if ($index + 2 < scalar @$graphroute) { }
593 0 0 defined $next_next_line_station_id ? :
594 0 0 if defined $next_conn
601 0 0 if $prev_step
602 0 0 if $next_step
604 0 0 if defined $next_step
619 0 0 if $route->transfer_on_first_station
620 0 0 if $route->transfer_on_final_station
625 0 0 if $self->has_wanted_hook_plugins
631 0 0 @_ ? :
0 0 if @_ != 0