blib/lib/Text/Trac/LinkResolver/Log.pm

filter: Statementstmt 100% 20 / 20 Branchbran 75.0% 3 / 4 Conditioncond 80.0% 4 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 84.6% 33 / 39 SCAR 16.1
CC
5
Cov
93%
format_link
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« blib/lib/Text/Trac/LinkResolver/Report.pm ↑ Summary blib/lib/Text/Trac/LinkResolver/Changeset.pm »
1 package Text::Trac::LinkResolver::Log;
2  
3 48 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 48 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 48 ▶use base qw( Text::Trac::LinkResolver );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 48 our $VERSION = '0.23';
8  
9 sub init {
10 5462 ▶ my $self = shift;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
11 5462 $self->{pattern} = '!?\[\d+:\d+\]|(?:\b|!)r\d+:\d+\b';
12 }
13  
14 sub format_link {
15 8 ▶ my ( $self, $match, $target, $label ) = @_;
Subroutine format_link: called CC=5 SCAR=16.2
Pod undocumented
16 8 ▶ return $match if $self->_is_disabled;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_disabled 1 7 8
17  
18 7 my $c = $self->{context};
19 7 ▶ $label ||= $match;
Condition66%2/3
$label ||= $match
l!l&&r!l&&!r
340
MC/DC0%0/2
$label ||= $match
$label $match
Truth table66%2/3
A ||= B
A= $labelB= $match
ABresult
1X1
011
000
20 7 my ( $from, $to ) = ( $match =~ m/(\d+):(\d+)/ );
21  
22 7 ▶ my $url = $c->{trac_log_url} || $c->trac_url . 'log/';
Condition100%2/2
$c->{'trac_log_url'} || $c->trac_url . 'log/'
l!l
16
MC/DC100%1/1
$c->{'trac_log_url'} || $c->trac_url . 'log/'
$c->{'trac_log_url'}
Truth table100%2/2
A
A= $c->{'trac_log_url'}
Aresult
11
00
23 7 ▶ return sprintf '<a %s href="%s?rev=%s&amp;stop_rev=%s">%s</a>', ( $c->{class} ? q{class="source"} : '' ), $url,
Branch: 1 branch
BranchTrueFalseTotal
$c->{'class'} ? : 7 0 7
24 $to, $from, $label;
25 }
26  
27 48 1;
« blib/lib/Text/Trac/LinkResolver/Report.pm ↑ Summary blib/lib/Text/Trac/LinkResolver/Changeset.pm »