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

filter: Statementstmt 100% 20 / 20 Branchbran 75.0% 3 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 82.0% 32 / 39 SCAR 16.1
CC
5
Cov
90%
format_link
5.1
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« blib/lib/Text/Trac/LinkResolver/Attachment.pm ↑ Summary blib/lib/Text/Trac/LinkResolver/Report.pm »
1 package Text::Trac::LinkResolver::Milestone;
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 }
12  
13 sub format_link {
14 6 ▶ my ( $self, $match, $target, $label ) = @_;
Subroutine format_link: called CC=5 SCAR=16.4
Pod undocumented
15 6 ▶ return $match if $self->_is_disabled;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_disabled 1 5 6
16  
17 5 my $c = $self->{context};
18 5 ▶ $label ||= $match;
Condition33%1/3
$label ||= $match
l!l&&r!l&&!r
500
MC/DC0%0/2
$label ||= $match
$label $match
Truth table33%1/3
A ||= B
A= $labelB= $match
ABresult
1X1
011
000
19 5 my ( $from, $to ) = ( $match =~ m/(\d+):(\d+)/ );
20  
21 5 ▶ my $url = $c->{trac_milestone_url} || $c->trac_url . 'milestone/';
Condition100%2/2
$c->{'trac_milestone_url'} || $c->trac_url . 'milestone/'
l!l
14
MC/DC100%1/1
$c->{'trac_milestone_url'} || $c->trac_url . 'milestone/'
$c->{'trac_milestone_url'}
Truth table100%2/2
A
A= $c->{'trac_milestone_url'}
Aresult
11
00
22 5 $url .= $target;
23  
24 5 ▶ return sprintf '<a %s href="%s">%s</a>', ( $c->{class} ? q{class="milestone"} : '' ), $url, $label;
Branch: 1 branch
BranchTrueFalseTotal
$c->{'class'} ? : 5 0 5
25 }
26  
27 48 1;
« blib/lib/Text/Trac/LinkResolver/Attachment.pm ↑ Summary blib/lib/Text/Trac/LinkResolver/Report.pm »