YAML/Marshall.pm

filter: Statementstmt 100% 43 / 43 Branchbran 66.6% 4 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 4 totaltotal 91.0% 61 / 67 CC 5 SCAR 5.1
CC
5
Cov
96%
import
3.0
yaml_load
2.0
yaml_dump
2.0
CRAP 1.7
« YAML/Loader/Base.pm ↑ Summary YAML/Tag.pm »
1 2 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package YAML::Marshall;
3  
4 2 ▶use YAML::Node ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶sub import {
Subroutine import: called CC=3 SCAR=11.0
7 4 my $class = shift;
8 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 my $package = caller;
10 4 ▶ unless (grep { $_ eq $class} @{$package . '::ISA'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq $class;} @{$package . '::ISA';}) 4 0 4
11 4 push @{$package . '::ISA'}, $class;
12 }
13  
14 4 my $tag = shift;
15 4 ▶ if ( $tag ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tag) 1 3 4
16 2 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 $YAML::TagClass->{$tag} = $package;
18 1 ${$package . "::YamlTag"} = $tag;
19 }
20 }
21  
22 3 ▶sub yaml_dump {
Subroutine yaml_dump: called CC=2 SCAR=6.9
Pod undocumented
23 3 my $self = shift;
24 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 ▶ my $tag = ${ref($self) . "::YamlTag"} || 'perl/' . ref($self);
Condition100%2/2
${ref($self) . '::YamlTag';} || 'perl/' . ref($self)
l!l
12
MC/DC100%1/1
${ref($self) . '::YamlTag';} || 'perl/' . ref($self)
${ref($self) . '::YamlTag';}
Truth table100%2/2
A
A= ${ref($self) . '::YamlTag';}
Aresult
11
00
26 3 $self->yaml_node($self, $tag);
27 }
28  
29 2 ▶sub yaml_load {
Subroutine yaml_load: called CC=2 SCAR=7.0
Pod undocumented
30 2 my ($class, $node) = @_;
31 2 ▶ if (my $ynode = $class->yaml_ynode($node)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $ynode = $class->yaml_ynode($node)) 2 0 2
32 2 $node = $ynode->{NODE};
33 }
34 2 bless $node, $class;
35 }
36  
37 4 ▶sub yaml_node {
Subroutine yaml_node: called CC=1 SCAR=0.0
Pod undocumented
38 4 shift;
39 4 YAML::Node->new(@_);
40 }
41  
42 2 ▶sub yaml_ynode {
Subroutine yaml_ynode: called CC=1 SCAR=0.0
Pod undocumented
43 2 shift;
44 2 YAML::Node::ynode(@_);
45 }
46  
47 2 1;
« YAML/Loader/Base.pm ↑ Summary YAML/Tag.pm »