LibXSLT/Cache.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 67.5% 25 / 37 CC 3 SCAR 8.2
CC
3
Cov
66%
new
3.7
parse_stylesheet_file
2.0
__ANON__
2.0
CRAP 2.3
« LibXML/Cache/Base.pm ↑ Summary LibXML/Cache.pm »
1 package XML::LibXSLT::Cache;
2 1 $XML::LibXSLT::Cache::VERSION = '0.14';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Style sheet cache for XML::LibXSLT
7  
8 1 ▶use base qw(XML::LibXML::Cache::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶sub new {
Subroutine new: called CC=3 SCAR=13.1
Pod documented
11 1 my $class = shift;
12 1 ▶ my $options = @_ > 1 ? { @_ } : $_[0];
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 0 1 1
13  
14 1 my $self = $class->SUPER::new;
15  
16 1 my $xslt = $options->{xslt};
17
18 1 ▶ if (!$xslt) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($xslt) 1 0 1
19 1 require XML::LibXSLT;
20 0 $xslt = XML::LibXSLT->new;
21 }
22  
23 0 $self->{xslt} = $xslt;
24  
25 0 $xslt->input_callbacks($XML::LibXML::Cache::Base::input_callbacks);
26  
27 0 return $self;
28 }
29  
30 0 ▶sub parse_stylesheet_file {
Subroutine parse_stylesheet_file: not called CC=1 SCAR=6.9
Pod documented
31 0 my ($self, $filename) = @_;
32  
33 0 ▶ return $self->_cache_lookup($filename, sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 0 my $filename = shift;
35  
36 0 return $self->{xslt}->parse_stylesheet_file($filename);
37 0 });
38 }
39  
40 1 1;
41  
42 __END__
« LibXML/Cache/Base.pm ↑ Summary LibXML/Cache.pm »