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

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 80.0% 4 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 87.5% 35 / 40 SCAR 16.1
CC
5
Cov
97%
format_link
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« blib/lib/Text/Trac/LinkResolver/Changeset.pm ↑ Summary blib/lib/Text/Trac/Table.pm »
1 package Text::Trac::LinkResolver::Ticket;
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+';
12 }
13  
14 sub format_link {
15 20 ▶ my ( $self, $match, $target, $label ) = @_;
Subroutine format_link: called CC=5 SCAR=16.1
Pod undocumented
16 20 ▶ return $match if $self->_is_disabled;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_disabled 1 19 20
17  
18 19 my $c = $self->{context};
19 19 ▶ $label ||= $match;
Condition66%2/3
$label ||= $match
l!l&&r!l&&!r
4150
MC/DC0%0/2
$label ||= $match
$label $match
Truth table66%2/3
A ||= B
A= $labelB= $match
ABresult
1X1
011
000
20 19 my ($rev) = ( $match =~ m/(\d+)/ );
21  
22 19 ▶ my $url = $c->{trac_ticket_url} || $c->trac_url . 'ticket/';
Condition100%2/2
$c->{'trac_ticket_url'} || $c->trac_url . 'ticket/'
l!l
118
MC/DC100%1/1
$c->{'trac_ticket_url'} || $c->trac_url . 'ticket/'
$c->{'trac_ticket_url'}
Truth table100%2/2
A
A= $c->{'trac_ticket_url'}
Aresult
11
00
23 19 $url .= $rev;
24 19 ▶ return sprintf '<a %s href="%s">%s</a>', ( $c->{class} ? q{class="ticket"} : '' ), $url, $label;
Branch: 1 branch
BranchTrueFalseTotal
$c->{'class'} ? : 9 10 19
25 }
26  
27 48 1;
« blib/lib/Text/Trac/LinkResolver/Changeset.pm ↑ Summary blib/lib/Text/Trac/Table.pm »