BCSSH/Options/Accessor.pm

filter: Statementstmt 85.0% 17 / 20 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 78.1% 25 / 32 CC 4 SCAR 11.4
CC
4
Cov
77%
__ANON__
5.3
make_variant
1.1
BEGIN
1.0
CRAP 3.1
« BCSSH/Command/ping.pm ↑ Summary BCSSH/Command/browse.pm »
1 package App::BCSSH::Options::Accessor;
2 1 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 use Package::Variant
4 1 ▶ importing => ['Role::Tiny'],
Subroutine BEGIN: called CC=1 SCAR=0.0
5 subs => [ qw(before after) ],
6 1 ;
7 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶sub make_variant {
Subroutine make_variant: called CC=1 SCAR=0.5
Pod undocumented
10 4 my ($class, $target_package, $cb) = @_;
11  
12 20 ▶ before generate_method => sub {
Subroutine __ANON__: called CC=4 SCAR=16.6
13 20 my ($self, $into, $name, $spec) = @_;
14 20 ▶ if (my $arg_spec = delete $spec->{arg_spec}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $arg_spec = delete $spec->{"arg_spec"}) 4 16 20
15 4 my $attr = $name;
16 4 ▶ if (exists $spec->{init_arg}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $spec->{"init_arg"}) 0 4 4
17 0 ▶ if (!defined $spec->{init_arg}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $spec->{"init_arg"}) 0 0 0
18 0 croak "Can't define a arg_spec for an attribute with init_arg => undef";
19 }
20 0 $attr = $spec->{init_arg};
21 }
22 4 $cb->($into, $attr, $arg_spec);
23 }
24 4 };
25 }
26  
27 1 1;
28 __END__
« BCSSH/Command/ping.pm ↑ Summary BCSSH/Command/browse.pm »