/usr/local/lib/perl5/5.44.0/x86_64-linux/Encode/Encoding.pm

filter: Statementstmt 65.9% 31 / 47 Branchbran 0.0% 0 / 8 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 50.0% 9 / 18 Podpod 72.7% 8 / 11 totaltotal 58.6% 51 / 87 CC 6 SCAR 11.0
CC
6
Cov
58%
Define
6.0
perlio_ok
6.0
encode
6.0
CRAP 3.0
« lib/Skilletor/Entry.pm ↑ Summary /usr/local/lib/perl5/site_perl/5.44.0/x86_64-linux/Class/XSAccessor/Heavy.pm »
1 package Encode::Encoding;
2  
3 # Base class for classes which implement encodings
4 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 our $VERSION = do { my @r = ( q$Revision: 2.8 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
7  
8 7 our @CARP_NOT = qw(Encode Encode::Encoder);
9  
10 7 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Encode::MIME::Name;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 7 ▶use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub Define {
Subroutine Define: not called CC=2 SCAR=17.9
Pod undocumented
17 0 my $obj = shift;
18 0 my $canonical = shift;
19 0 ▶ $obj = bless { Name => $canonical }, $obj unless ref $obj;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $obj 0 0 0
20  
21 # warn "$canonical => $obj\n";
22 0 Encode::define_encoding( $obj, $canonical, @_ );
23 }
24  
25 0 ▶sub name { return shift->{'Name'} }
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
26  
27 0 ▶sub mime_name {
Subroutine mime_name: not called CC=1 SCAR=6.9
Pod documented
28 0 return Encode::MIME::Name::get_mime_name(shift->name);
29 }
30  
31 7 ▶sub renew {
Subroutine renew: called CC=1 SCAR=0.0
Pod documented
32 7 my $self = shift;
33 7 my $clone = bless {%$self} => ref($self);
34 7 $clone->{renewed}++; # so the caller can see it
35 7 DEBUG and warn $clone->{renewed};
36 7 return $clone;
37 }
38  
39 275 ▶sub renewed { return $_[0]->{renewed} || 0 }
Subroutine renewed: called CC=2 SCAR=6.9
Pod documented
Condition100%2/2
$_[0]{'renewed'} || 0
l!l
21758
MC/DC100%1/1
$_[0]{'renewed'} || 0
$_[0]{'renewed'}
Truth table100%2/2
A
A= $_[0]{'renewed'}
Aresult
11
00
40  
41 7 *new_sequence = \&renew;
42  
43 7 ▶sub needs_lines { 0 }
Subroutine needs_lines: called CC=1 SCAR=0.0
Pod documented
44  
45 0 ▶sub perlio_ok {
Subroutine perlio_ok: not called CC=2 SCAR=17.9
Pod documented
46 0 ▶ return eval { require PerlIO::encoding } ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require PerlIO::encoding } } ? : 0 0 0
47 }
48  
49 # (Temporary|legacy) methods
50  
51 0 ▶sub toUnicode { shift->decode(@_) }
Subroutine toUnicode: not called CC=1 SCAR=6.9
Pod undocumented
52 0 ▶sub fromUnicode { shift->encode(@_) }
Subroutine fromUnicode: not called CC=1 SCAR=6.9
Pod undocumented
53  
54 #
55 # Needs to be overloaded or just croak
56 #
57  
58 0 ▶sub encode {
Subroutine encode: not called CC=2 SCAR=17.9
Pod documented
59 0 my $obj = shift;
60 0 ▶ my $class = ref($obj) ? ref($obj) : $obj;
Branch: 1 branch
BranchTrueFalseTotal
ref $obj ? : 0 0 0
61 0 Carp::croak( $class . "->encode() not defined!" );
62 }
63  
64 0 ▶sub decode {
Subroutine decode: not called CC=2 SCAR=17.9
Pod documented
65 0 my $obj = shift;
66 0 ▶ my $class = ref($obj) ? ref($obj) : $obj;
Branch: 1 branch
BranchTrueFalseTotal
ref $obj ? : 0 0 0
67 0 Carp::croak( $class . "->encode() not defined!" );
68 }
69  
70 0 ▶sub DESTROY { }
Subroutine DESTROY: not called CC=1 SCAR=0.0
71  
72 7 1;
73 __END__
« lib/Skilletor/Entry.pm ↑ Summary /usr/local/lib/perl5/site_perl/5.44.0/x86_64-linux/Class/XSAccessor/Heavy.pm »