FindApp/Utils/Foreign.pm

filter: Statementstmt 87.8% 36 / 41 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 82.3% 14 / 17 Podpod 100% 2 / 2 totaltotal 85.9% 55 / 64 CC 3 SCAR 3.9
CC
3
Cov
87%
BEGIN
3.0
basename
2.0
abs2rel
2.0
CRAP 1.5
« FindApp/Object/State/Group/Class.pm ↑ Summary FindApp/Vars.pm »
1 package FindApp::Utils::Foreign;
2  
3 6 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 ▶use File::Spec qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 #################################################################
10  
11 6 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 6 our $VERSION = v1.0;
13  
14 6 ▶my %Exported_Imports; BEGIN {
Subroutine BEGIN: called CC=3 SCAR=11.0
15  
16 6 %Exported_Imports = (
17 "Carp" => [ qw(carp croak cluck confess) ],
18 "Cwd" => [ qw(abs_path getcwd) ],
19 "Data::Dump" => [ qw(dd pp) ],
20 "File::Basename" => [ qw(basename dirname fileparse) ],
21 "Scalar::Util" => [ qw(blessed looks_like_number refaddr reftype set_prototype) ],
22 );
23  
24 6 ▶ while (my($module, $imports) = each %Exported_Imports) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Exported_Imports) 30 6 36
25 30 ▶ eval qq{ require $module; 1 } || die;
Branch: 1 branch
BranchTrueFalseTotal
eval " require $module; 1 " or die 30 0 30
26 30 $module->import(@$imports);
27 }
28  
29 }
30  
31 {
32 6 ▶ no warnings qw(redefine prototype);
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 14 ▶ sub abs_path(_) { &Cwd::abs_path }
Subroutine abs_path: called CC=1 SCAR=0.0
35 0 ▶ sub basename(_;$) { &File::Basename::basename }
Subroutine basename: not called CC=1 SCAR=6.9
36 1187 ▶ sub blessed(_) { &Scalar::Util::blessed }
Subroutine blessed: called CC=1 SCAR=0.0
37 30 ▶ sub dirname(_) { &File::Basename::dirname }
Subroutine dirname: called CC=1 SCAR=0.0
38 4 ▶ sub getcwd() { &Cwd::getcwd }
Subroutine getcwd: called CC=1 SCAR=0.0
39 23 ▶ sub looks_like_number(_) { &Scalar::Util::looks_like_number }
Subroutine looks_like_number: called CC=1 SCAR=0.0
40 30 ▶ sub refaddr(_) { &Scalar::Util::refaddr }
Subroutine refaddr: called CC=1 SCAR=0.0
41 668 ▶ sub reftype(_) { &Scalar::Util::reftype }
Subroutine reftype: called CC=1 SCAR=0.0
42 }
43  
44 6 our @EXPORT_OK = sort abs2rel => map { @$_ } values %Exported_Imports;
45  
46 6 our %EXPORT_TAGS = %Exported_Imports;
47 6 $EXPORT_TAGS{all} = \@EXPORT_OK;
48  
49 0 ▶sub abs2rel(_) {
Subroutine abs2rel: not called CC=1 SCAR=6.9
Pod documented
50 0 ▶ my($path) = @_;
Subroutine abs2rel: not called CC=1 SCAR=6.9
Pod documented
51 0 return File::Spec->abs2rel($path);
52 }
53  
54 6 1;
55  
56 =encoding utf8
57  
58 =head1 NAME
59  
60 FindApp::Utils::Foreign - FIXME
61  
62 =head1 SYNOPSIS
63  
64 use FindApp::Utils::Foreign;
65  
66 =head1 DESCRIPTION
67  
68 =head2 Exports
69  
70 =over
71  
72 =item abs2rel
73  
74 =back
75  
76 =head1 ENVIRONMENT
77  
78 =head1 SEE ALSO
79  
80 =over
81  
82 =item L<FindApp>
83  
84 =back
85  
86 =head1 CAVEATS AND PROVISOS
87  
88 =head1 BUGS AND LIMITATIONS
89  
90 =head1 HISTORY
91  
92 =head1 AUTHOR
93  
94 Tom Christiansen << <tchrist@perl.com> >>
95  
96 =head1 LICENCE AND COPYRIGHT
97  
98 Copyright (c) 2016, Tom Christiansen C<< <tchrist@perl.com> >>.
99 All Rights Reserved.
100  
101 This module is free software; you can redistribute it and/or
102 modify it under the same terms as Perl itself. See L<perlartistic>.
103  
104 =cut
105  
« FindApp/Object/State/Group/Class.pm ↑ Summary FindApp/Vars.pm »