Tie/Plugin.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 86.1% 31 / 36 CC 3 SCAR 6.3
CC
3
Cov
92%
canon_args
3.0
provides
2.0
BEGIN
1.0
CRAP 1.9
« Tie.pm ↑ Summary Tie/Plugin/List.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Pad::Tie::Plugin;
5  
6 1 ▶use Data::OptList;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub provides {
Subroutine provides: not called CC=1 SCAR=6.9
Pod documented
10 0 Carp::confess "subclass $_[0] did not override virtual method 'provides'";
11 }
12  
13 # input: ( [ foo => { -as => 'bar' } ], ... )
14 # return: { foo => 'bar', ... }
15 7 ▶sub canon_args {
Subroutine canon_args: called CC=3 SCAR=11.0
Pod documented
16 7 my ($plugin, $args) = @_;
17  
18 7 my %n;
19 7 my @args = @{ Data::OptList::mkopt($args) };
20 7 for (@args) {
21 7 my ($method, $xtra) = @$_;
22 7 ▶ my $name = $xtra->{-as} || $method;
Condition66%2/3
$xtra->{'-as'} || $method
l!l&&r!l&&!r
430
MC/DC0%0/2
$xtra->{'-as'} || $method
$xtra->{'-as'} $method
Truth table66%2/3
A || B
A= $xtra->{'-as'}B= $method
ABresult
1X1
011
000
23 #$name = "$xtra->{-prefix}$name" if $xtra->{-prefix};
24 7 $n{$method} = $name;
25 }
26 7 return \%n;
27 }
28  
29 1 1;
30  
31 __END__
« Tie.pm ↑ Summary Tie/Plugin/List.pm »