| 1 | package HTML::Zoom::ZConfig; | ||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||
| 3 | 15 | ▶ | use strictures 1; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||
| 5 | 15 | my %DEFAULTS = ( | |||||||||||||||||||||||||||||||||||||
| 6 | parser => 'HTML::Zoom::Parser::BuiltIn', | ||||||||||||||||||||||||||||||||||||||
| 7 | producer => 'HTML::Zoom::Producer::BuiltIn', | ||||||||||||||||||||||||||||||||||||||
| 8 | filter_builder => 'HTML::Zoom::FilterBuilder', | ||||||||||||||||||||||||||||||||||||||
| 9 | selector_parser => 'HTML::Zoom::SelectorParser', | ||||||||||||||||||||||||||||||||||||||
| 10 | stream_utils => 'HTML::Zoom::StreamUtils', | ||||||||||||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||
| 13 | 15 | my $ALL_DEFAULT; | |||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||
| 15 | 251 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=9 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 16 | 251 | my ($class, $args) = @_; | |||||||||||||||||||||||||||||||||||||
| 17 | 251 | ▶ | return $ALL_DEFAULT if $ALL_DEFAULT && !keys %{$args||{}}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
$ALL_DEFAULT and not keys %{$args or {};}
$args || {}
MC/DC50%1/2
$ALL_DEFAULT and not keys %{$args or {};}
$ALL_DEFAULT
not keys %{$args or {};}
MC/DC100%1/1
$args || {}
$args
Truth table66%2/3
A and not(B)
A= $ALL_DEFAULTB= not keys %{$args or {};}
Truth table100%2/2
A
A= $args
| |||||||||||||||||||||||||||||||||||||||
| 18 | 13 | my $new = {}; | |||||||||||||||||||||||||||||||||||||
| 19 | 13 | foreach my $arg_name (keys %DEFAULTS) { | |||||||||||||||||||||||||||||||||||||
| 20 | 65 | ▶ | $new->{$arg_name} = $args->{$arg_name} || $DEFAULTS{$arg_name}; | ||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{$arg_name} || $DEFAULTS{$arg_name}
MC/DC0%0/2
$args->{$arg_name} || $DEFAULTS{$arg_name}
$args->{$arg_name}
$DEFAULTS{$arg_name}
Truth table33%1/3
A || B
A= $args->{$arg_name}B= $DEFAULTS{$arg_name}
| |||||||||||||||||||||||||||||||||||||||
| 21 | 65 | ▶ | if (ref($new->{$arg_name})) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 22 | 0 | $new->{$arg_name} = $new->{$arg_name}->with_zconfig($new); | |||||||||||||||||||||||||||||||||||||
| 23 | } else { | ||||||||||||||||||||||||||||||||||||||
| 24 | 65 | require(do { (my $m = $new->{$arg_name}) =~ s/::/\//g; "${m}.pm" }); | |||||||||||||||||||||||||||||||||||||
| 25 | 65 | $new->{$arg_name} = $new->{$arg_name}->new({ zconfig => $new }); | |||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||
| 28 | 13 | ▶ | $ALL_DEFAULT = $new if !keys %{$args||{}}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$args || {}
MC/DC0%0/1
$args || {}
$args
Truth table50%1/2
A
A= $args
| |||||||||||||||||||||||||||||||||||||||
| 29 | 13 | bless($new, $class); | |||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||
| 32 | 190 | ▶ | sub parser { shift->{parser} } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
parser: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 33 | 60 | ▶ | sub producer { shift->{producer} } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
producer: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 34 | 157 | ▶ | sub filter_builder { shift->{filter_builder} } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
filter_builder: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 35 | 130 | ▶ | sub selector_parser { shift->{selector_parser} } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
selector_parser: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 36 | 665 | ▶ | sub stream_utils { shift->{stream_utils} } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
stream_utils: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||
| 38 | 15 | 1; | |||||||||||||||||||||||||||||||||||||