FromMail/Object.pm

filter: Statementstmt 45.4% 15 / 33 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 50.0% 4 / 8 Podpod 75.0% 3 / 4 totaltotal 37.2% 22 / 59 CC 7 SCAR 22.6
CC
7
Cov
34%
settings
20.0
init
12.0
plain2html
6.0
CRAP 9.6
« FromMail/Default/HTMLifiers.pm ↑ Summary FromMail/Format/OODoc.pm »
1 # This code is part of Perl distribution HTML-FromMail version 4.00.
2 # The POD got stripped from this file by OODoc version 3.05.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2003-2025 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package HTML::FromMail::Object;{
13 1 our $VERSION = '4.00';
14 }
15  
16 1 ▶use base 'Mail::Reporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Log::Report 'html-frommail';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #--------------------
24  
25 sub init($)
26 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=3 SCAR=24.8
Pod undocumented
27 0 $self->SUPER::init($args);
28  
29 0 ▶ $self->{HFO_topic} = $args->{topic} // panic "No topic";
Condition0%0/3
$args->{"topic"} // &panic("No topic")
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{"topic"} // &panic("No topic")
$args->{"topic"} &panic("No topic")
Truth table0%0/3
A // B
A= $args->{"topic"}B= &panic("No topic")
ABresult
1X1
011
000
30 0 ▶ $self->{HFO_settings} = $args->{settings} || {};
Condition0%0/2
$args->{'settings'} || {}
l!l
00
MC/DC0%0/1
$args->{'settings'} || {}
$args->{'settings'}
Truth table0%0/2
A
A= $args->{'settings'}
Aresult
11
00
31 0 $self;
32 }
33  
34 #--------------------
35  
36 0 ▶sub topic() { $_[0]->{HFO_topic} }
Subroutine topic: not called CC=1 SCAR=6.9
Pod documented
37  
38  
39 sub settings(;$)
40 0 ▶{ my $self = shift;
Subroutine settings: not called CC=4 SCAR=30.0
Pod documented
41 0 ▶ my $topic = @_ ? shift : $self->topic;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
42 0 ▶ defined $topic or return {};
Branch: 1 branch
BranchTrueFalseTotal
defined $topic or return {} 0 0 0
43 0 ▶ $self->{HFO_settings}{$topic} || {};
Branch: 1 branch
BranchTrueFalseTotal
$self->{"HFO_settings"}{$topic} or {} 0 0 0
44 }
45  
46 #--------------------
47  
48 sub plain2html($)
49 0 ▶{ my $self = shift;
Subroutine plain2html: not called CC=2 SCAR=17.9
Pod documented
50 0 my $string = join '', @_;
51 0 for($string)
52 0 { s/\&/\&/g;
53 0 s/\</\&lt;/g;
54 0 s/\>/\&gt;/g;
55 0 s/"/\&quot;/g;
56 }
57 0 $string;
58 }
59  
60 1 1;
« FromMail/Default/HTMLifiers.pm ↑ Summary FromMail/Format/OODoc.pm »