blib/lib/Text/Trac/LinkResolver.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 97.3% 36 / 37 SCAR 6.9
CC
2
Cov
100%
_is_disabled
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Text/Trac/Hr.pm ↑ Summary script/trac2html »
1 package Text::Trac::LinkResolver;
2  
3 53 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 53 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 53 ▶use List::MoreUtils qw( any );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 53 our $VERSION = '0.23';
8  
9 53 our @handlers = qw( changeset wiki report log ticket milestone source attachment comment );
10  
11 sub new {
12 49158 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
13 49158 my $self = { context => shift };
14 49158 bless $self, $class;
15 49158 $self->init;
16 49158 return $self;
17 }
18  
19 sub _is_disabled {
20 516 ▶ my ( $self, $resolver ) = @_;
Subroutine _is_disabled: called CC=2 SCAR=6.9
21 516 ( my $formatter = ref $self ) =~ s/.*:://;
22  
23 516 ▶ if ( @{ $self->{context}->{enable_links} } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$self->{"context"}{"enable_links"};}) 3 513 516
24 3 ▶ return !any { lcfirst($formatter) eq $_ } @{ $self->{context}->{enable_links} };
Subroutine __ANON__: called CC=1 SCAR=0.0
25 }
26  
27 513 ▶ return any { lcfirst($formatter) eq $_ } @{ $self->{context}->{disable_links} };
Subroutine __ANON__: called CC=1 SCAR=0.0
28 }
29 53 1;
« blib/lib/Text/Trac/Hr.pm ↑ Summary script/trac2html »