Stenciller/Utils.pm

filter: Statementstmt 89.8% 97 / 108 Branchbran 30.0% 9 / 30 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.3% 12 / 13 Podpod n/a totaltotal 78.1% 118 / 151 SCAR 29.5
CC
16
Cov
77%
eval
29.1
eval_to_hashref
10.9
BEGIN
1.4
CRAP 19.2
« Stenciller/Transformer.pm ↑ Summary Stenciller/Plugin/ToHtmlPreBlock.pm »
1 13 ▶use Stenciller::Standard;
Subroutine __ANON__: called CC=1 SCAR=0.0
2 13 ▶use strict;
Subroutine __ANON__: called CC=1 SCAR=0.0
3 7 ▶use warnings;
Subroutine __ANON__: called CC=1 SCAR=0.0
4  
5 # PODNAME: Stenciller::Utils
6 7  
7 7 ▶role Stenciller::Utils using Moose {
Subroutine __ANON__: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
8  
9 1 our $VERSION = '0.1302'; # VERSION:
10  
11 7 ▶ method eval_to_hashref(Str $possible_hash!, Path|Str $faulty_file! --> HashRef) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine eval_to_hashref: called CC=10 SCAR=23.8
Branch: 8 branches
BranchTrueFalseTotal
@_ ? : 11 0 11
if @_ != 2 0 11 11
$#_ >= 0 ? : 11 0 11
if ($#_ >= 0) 11 0 11
Type::Tiny::XS::Str($possible_hash) or _failed_check(9, "Str", $possible_hash, "exception_class", "Error::TypeTiny::Assertion") 0 11 11
$#_ >= 1 ? : 11 0 11
if ($#_ >= 1) 11 0 11
Type::Tiny::XS::AUTO::TC7($faulty_file) or _failed_check(64, "Path|Str", $faulty_file, "exception_class", "Error::TypeTiny::Assertion") 0 11 11
12 11 my $settings = eval $possible_hash;
13 11 ▶ die sprintf "Can't parse stencil start: <%s> in %s: %s", $possible_hash, $faulty_file, $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 11 11
14 11 return $settings;
15 }
16 7 ▶ method eval(Str $string!) {
Subroutine BEGIN: called CC=1 SCAR=3.2
Subroutine BEGIN: called CC=1 SCAR=3.2
Subroutine eval: not called CC=7 SCAR=33.7
Branch: 5 branches
BranchTrueFalseTotal
@_ ? : 0 0 0
if @_ != 1 0 0 0
$#_ >= 0 ? : 0 0 0
if ($#_ >= 0) 0 0 0
Type::Tiny::XS::Str($string) or _failed_check(9, "Str", $string, "exception_class", "Error::TypeTiny::Assertion") 0 0 0
17 0 eval $string;
18 0 ▶ die sprintf "Can't parse %s: %s", $string, $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
19 0 return 1;
20 }
21 }
22  
23 7 1;
24  
25 __END__
26  
27 =pod
28  
29 =encoding UTF-8
30  
31 =head1 NAME
32  
33 Stenciller::Utils
34  
35 =head1 VERSION
36  
37 Version 0.1302, released 2015-11-28.
38  
39 =head1 SOURCE
40  
41 L<https://github.com/Csson/p5-Stenciller>
42  
43 =head1 HOMEPAGE
44  
45 L<https://metacpan.org/release/Stenciller>
46  
47 =head1 AUTHOR
48  
49 Erik Carlsson <info@code301.com>
50  
51 =head1 COPYRIGHT AND LICENSE
52  
53 This software is copyright (c) 2015 by Erik Carlsson.
54  
55 This is free software; you can redistribute it and/or modify it under
56 the same terms as the Perl 5 programming language system itself.
57  
58 =cut
« Stenciller/Transformer.pm ↑ Summary Stenciller/Plugin/ToHtmlPreBlock.pm »