lib/Mite/Miteception.pm

filter: Statementstmt 51.4% 36 / 70 Branchbran 25.0% 4 / 16 Conditioncond 33.3% 6 / 18 MC/DCmcdc 10.0% 1 / 10 Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 2 totaltotal 43.6% 55 / 126 CC 17 SCAR 23.7
CC
17
Cov
44%
load_mite_file
14.4
load_mite_file
14.4
import
12.6
CRAP 10.7
« lib/Mite/Signature.pm ↑ Summary blib/lib/Mite/Signature/Compiler.pm »
1 134 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 134 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 134 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Mite::Miteception;
6  
7 134 our $AUTHORITY = 'cpan:TOBYINK';
8 134 our $VERSION = '0.013000';
9  
10 134 ▶use Import::Into;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 134 ▶use Mite::Shim ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 134 ▶use Mite::Types ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1832 ▶sub import {
Subroutine import: called CC=4 SCAR=25.3
15 0 ▶ 'Mite::Types'->import::into( 1, qw( -types slurpy ) );
Subroutine import: not called CC=4 SCAR=25.3
16  
17 0 ▶ if ( Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME ) {
Branch: 2 branches
BranchTrueFalseTotal
if (Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME) { } 0 1832 1832
if (Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME) { } 0 0 0
Condition33%2/6
Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME
!ll&&!rl&&r
1758740
Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME
!ll&&!rl&&r
000
MC/DC0%0/2
Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME
Mite::Shim::_is_compiling() defined $Mite::REAL_FILENAME
MC/DC0%0/2
Mite::Shim::_is_compiling() and defined $Mite::REAL_FILENAME
Mite::Shim::_is_compiling() defined $Mite::REAL_FILENAME
Truth table66%2/3
A and B
A= Mite::Shim::_is_compiling()B= defined $Mite::REAL_FILENAME
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= Mite::Shim::_is_compiling()B= defined $Mite::REAL_FILENAME
ABresult
0X0
100
111
18 0 my $class = shift;
19 0 my %arg = map { lc($_) => 1 } @_;
20 0 my ( $caller, $file ) = caller;
21 0 require Mite::Project;
22 Mite::Project->default->inject_mite_functions(
23 package => $caller,
24 file => $Mite::REAL_FILENAME,
25 arg => \%arg,
26 0 ▶ kind => ( $arg{'-role'} ? 'role' : 'class' ),
Branch: 2 branches
BranchTrueFalseTotal
$arg{'-role'} ? : 0 0 0
$arg{'-role'} ? : 0 0 0
27 shim => 'Mite::Shim',
28 );
29 }
30 else {
31 0 goto \&load_mite_file;
32 }
33 }
34  
35 # Stolen bits from Mite::Shim
36 1832 ▶sub load_mite_file {
Subroutine load_mite_file: called CC=6 SCAR=26.7
Pod undocumented
37 0 ▶ my $class = shift;
Subroutine load_mite_file: not called CC=6 SCAR=26.7
Pod undocumented
38 0 my %arg = map { lc $_ => 1 } @_;
39  
40 0 my ( $caller, $file ) = caller;
41  
42 0 require File::Spec;
43 0 my $orig = $file;
44 0 for my $base ( @INC ) {
45 0 ▶ $base eq substr $file, 0, length $base
Branch: 2 branches
BranchTrueFalseTotal
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base) and last 1832 3469 5301
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base) and last 0 0 0
Condition33%4/12
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base)
!ll&&!rl&&r
346901832
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base)))
!ll&&!rl&&r
346901832
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base)
!ll&&!rl&&r
000
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base)))
!ll&&!rl&&r
000
MC/DC33%1/3
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base)
$base eq substr($file, 0, length $base) -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) $orig = "File::Spec"->abs2rel($file, $base)
MC/DC0%0/3
$base eq substr($file, 0, length $base) and -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) and $orig = "File::Spec"->abs2rel($file, $base)
$base eq substr($file, 0, length $base) -f "File::Spec"->catfile($base, substr($file, 1 + length($base))) $orig = "File::Spec"->abs2rel($file, $base)
Truth table50%2/4
A and B and C
A= $base eq substr($file, 0, length $base)B= -f "File::Spec"->catfile($base, substr($file, 1 + length($base)))C= $orig = "File::Spec"->abs2rel($file, $base)
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/4
A and B and C
A= $base eq substr($file, 0, length $base)B= -f "File::Spec"->catfile($base, substr($file, 1 + length($base)))C= $orig = "File::Spec"->abs2rel($file, $base)
ABCresult
0XX0
10X0
1100
1111
46 and -f File::Spec->catfile( $base, substr $file, 1 + length $base )
47 and $orig = File::Spec->abs2rel( $file, $base )
48 and last;
49 }
50  
51 0 my $mite_file = $orig . ".mite.pm";
52 0 local $@;
53 0 ▶ if ( not eval { require $mite_file; 1 } ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not eval { do { require $mite_file; 1 } }) 0 1832 1832
if (not eval { do { require $mite_file; 1 } }) 0 0 0
54 0 my $e = $@;
55 0 require Carp;
56 0 Carp::croak("Compiled Mite file ($mite_file) for $file is missing or an error occurred loading it: $e");
57 }
58 }
59  
60 134 1;
« lib/Mite/Signature.pm ↑ Summary blib/lib/Mite/Signature/Compiler.pm »