XSS/Document.pm

filter: Statementstmt 100% 25 / 25 Branchbran 75.0% 3 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 91.8% 34 / 37 CC 4 SCAR 9.3
CC
4
Cov
94%
apply
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« XSS.pm ↑ Summary XSS/ProcessingInstruction.pm »
1 package XML::XSS::Document;
2 15 our $AUTHORITY = 'cpan:YANICK';
3 # ABSTRACT: XML::XSS document stylesheet rule
4 15 $XML::XSS::Document::VERSION = '0.3.5';
5  
6 15 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use MooseX::SemiAffordanceAccessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use MooseX::Clone;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 15 with 'XML::XSS::Role::Renderer', 'MooseX::Clone';
11  
12 15 ▶no warnings qw/ uninitialized /;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 15 has use_clean_stash => (
16 default => 1,
17 is => 'rw',
18 traits => [ 'Clone' ],
19 );
20  
21 15 has [ qw/ content pre post / ] => ( traits => [ qw/ XML::XSS::Role::StyleAttribute
22 Clone / ] );
23  
24  
25 48 ▶sub apply {
Subroutine apply: called CC=4 SCAR=14.0
26 48 my ( $self, $node, $args ) = @_;
27 48 ▶ $args ||= {};
Condition50%1/2
$args ||= {}
l!l
480
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
Aresult
11
00
28  
29 48 ▶ $self->stylesheet->clear_stash if $self->use_clean_stash;
Branch: 1 branch
BranchTrueFalseTotal
if $self->use_clean_stash 48 0 48
30  
31 48 my $output = $self->_render( 'pre', $node, $args );
32  
33 48 ▶ $output .= $self->has_content
Branch: 1 branch
BranchTrueFalseTotal
$self->has_content ? : 1 47 48
34 ? $self->_render( 'content', $node, $args )
35 : $self->render( $node->childNodes, $args )
36 ;
37  
38 48 $output .= $self->_render( 'post', $node, $args );
39  
40 48 return $output;
41 }
42  
43 15 1;
44  
45 __END__
« XSS.pm ↑ Summary XSS/ProcessingInstruction.pm »