SiteConfig/Root.pm

filter: Statementstmt 85.7% 24 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 3 totaltotal 77.5% 31 / 40 CC 2 SCAR 3.2
CC
2
Cov
83%
add_directive
2.0
to_string
2.0
BEGIN
1.0
CRAP 1.4
« SiteConfig/Statement.pm ↑ Summary SiteConfig/Directive.pm »
1 package Apache::SiteConfig::Root;
2 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use Apache::SiteConfig::Section;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Apache::SiteConfig::Directive;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 extends 'Apache::SiteConfig::Statement';
6  
7 2 ▶has statements => ( is => 'rw' , isa => 'ArrayRef' , default => sub { [ ] } );
Subroutine __ANON__: called CC=1 SCAR=0.0
8  
9 1 ▶sub add_directive {
Subroutine add_directive: called CC=2 SCAR=7.0
Pod undocumented
10 1 my ($self,$name,$values) = @_;
11 1 ▶ $values = ref($values) ? $values : [ $values ];
Branch: 1 branch
BranchTrueFalseTotal
ref $values ? : 1 0 1
12 1 my $dt = Apache::SiteConfig::Directive->new(
13 name => $name,
14 values => $values,
15 parent => $self,
16 );
17 1 push @{$self->statements} , $dt;
18 1 return $dt;
19 }
20  
21 1 ▶sub add_section {
Subroutine add_section: called CC=1 SCAR=0.0
Pod undocumented
22 1 my ($self,$name,$value) = @_;
23 1 my $section = Apache::SiteConfig::Section->new(
24 name => $name,
25 value => $value,
26 parent => $self,
27 );
28 1 push @{$self->statements} , $section;
29 1 return $section;
30 }
31  
32 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my ($self) = @_;
34 return join "\n",
35 0 (map { $_->to_string } @{ $self->statements });
36 }
37  
38  
39 2 1;
« SiteConfig/Statement.pm ↑ Summary SiteConfig/Directive.pm »