blib/lib/Object/Tiny/RW/XS.pm

filter: Statementstmt 100% 21 / 21 Branchbran 62.5% 5 / 8 Conditioncond 50.0% 3 / 6 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 81.4% 35 / 43 CC 7 SCAR 16.5
CC
7
Cov
83%
import
7.6
BEGIN
1.0
BEGIN
1.0
CRAP 5.2
↑ Summary
1 package Object::Tiny::RW::XS;
2
3 3 ▶use strict 'vars', 'subs';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 require 5.004;
6 3 $Object::Tiny::RW::XS::VERSION = '0.04';
7 }
8
9 3 ▶sub import {
Subroutine import: called CC=7 SCAR=20.3
10 3 ▶ return unless shift eq 'Object::Tiny::RW::XS';
Branch: 1 branch
BranchTrueFalseTotal
unless shift() eq "Object::Tiny::RW::XS" 0 3 3
11 3 my $pkg = caller;
12 3 my $child = !! @{"${pkg}::ISA"};
13 eval join "\n",
14 "package $pkg;",
15 ($child ? () : "\@${pkg}::ISA = 'Object::Tiny::RW::XS';"),
16 "use Class::XSAccessor accessors => {",
17 (map {
18 3 ▶ defined and ! ref and /^[^\W\d]\w*$/s
Subroutine BEGIN: called CC=1 SCAR=0.2
Branch: 2 branches
BranchTrueFalseTotal
$child ? : 0 3 3
defined $_ and not ref $_ and /^[^\W\d]\w*$/s or die "Invalid accessor name '${_}'" 4 1 5
Condition50%3/6
defined $_ and not ref $_ and /^[^\W\d]\w*$/s
!ll&&!rl&&r
014
defined $_ and not ref $_
!ll&&!rl&&r
005
MC/DC33%1/3
defined $_ and not ref $_ and /^[^\W\d]\w*$/s
defined $_ not ref $_ /^[^\W\d]\w*$/s
Truth table50%2/4
A and not(B) and C
A= defined $_B= not ref $_C= /^[^\W\d]\w*$/s
ABCresult
0XX0
10X0
1100
1111
19 or die "Invalid accessor name '$_'";
20 4 "'$_' => '$_',"
21 } @_),
22 "};";
23 2 ▶ die "Failed to generate $pkg" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 2 2
24 2 return 1;
25 }
26
27 use Class::XSAccessor
28 3 ▶ constructor => 'new';
Subroutine BEGIN: called CC=1 SCAR=0.0
29
30 3 1;
31
32 __END__
↑ Summary