blib/lib/Perl6/Builtins.pm

filter: Statementstmt 100% 39 / 39 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 4 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 13 / 13 Podpod n/a totaltotal 91.1% 62 / 68 CC 6 SCAR 8.1
CC
6
Cov
94%
import
5.1
_p6_caller
2.0
BEGIN
1.0
CRAP 2.3
↑ Summary
1 package Perl6::Builtins;
2  
3 4 ▶use version; $VERSION = qv('0.0.3');
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶sub import {
Subroutine import: called CC=5 SCAR=16.3
10 4 ▶ use Contextual::Return;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 my $package = shift;
12  
13 # system...
14 3 ▶ if (!@_ || grep m/\A system \z/xms, @_) {
Branch: 1 branch
BranchTrueFalseTotal
if (not @_ or grep /\A system \z/msx, @_) 3 0 3
Condition66%2/3
not @_ or grep /\A system \z/msx, @_
l!l&&r!l&&!r
210
MC/DC0%0/2
not @_ or grep /\A system \z/msx, @_
not @_ grep /\A system \z/msx, @_
Truth table66%2/3
not(A) or B
A= not @_B= grep /\A system \z/msx, @_
ABresult
1X1
011
000
15 3 *CORE::GLOBAL::system = \&_p6_system;
16 }
17  
18 # caller...
19 3 ▶ if (!@_ || grep m/\A caller \z/xms, @_) {
Branch: 1 branch
BranchTrueFalseTotal
if (not @_ or grep /\A caller \z/msx, @_) 2 1 3
Condition66%2/3
not @_ or grep /\A caller \z/msx, @_
l!l&&r!l&&!r
201
MC/DC50%1/2
not @_ or grep /\A caller \z/msx, @_
not @_ grep /\A caller \z/msx, @_
Truth table66%2/3
not(A) or B
A= not @_B= grep /\A caller \z/msx, @_
ABresult
1X1
011
000
20 2 *CORE::GLOBAL::caller = \&_p6_caller;
21 }
22 }
23  
24 4 ▶sub _p6_system {
Subroutine _p6_system: called CC=1 SCAR=0.0
25 4 undef $!;
26 4 my $status = CORE::system @_;
27 4 my $error = $!;
28 return
29 4 ▶ BOOL { !$status }
Subroutine __ANON__: called CC=1 SCAR=0.0
30 4 ▶ VALUE { $error };
Subroutine __ANON__: called CC=1 SCAR=0.0
31 }
32  
33 4 my @CALLER_FIELDS = qw(
34 package
35 file
36 line
37 sub
38 args
39 want
40 eval
41 require
42 hints
43 bitmask
44 );
45  
46 12 ▶sub _p6_caller {
Subroutine _p6_caller: called CC=2 SCAR=6.9
47 12 my @caller;
48 12 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 9 3 12
49 9 @caller = CORE::caller($_[0]+1);
50 }
51 else {
52 3 @caller = (CORE::caller(1))[0..2];
53 }
54 return (
55 9 ▶ HASHREF { my %hash;
Subroutine __ANON__: called CC=1 SCAR=0.0
56 9 @hash{@CALLER_FIELDS} = @caller;
57 9 \%hash;
58 }
59 1 ▶ SCALAR { $caller[0]; }
Subroutine __ANON__: called CC=1 SCAR=0.0
60 2 ▶ LIST { @caller; }
Subroutine __ANON__: called CC=1 SCAR=0.0
61 12 );
62 }
63  
64 4 1; # Magic true value required at end of module
65 __END__
↑ Summary