HAFAS/Message.pm

filter: Statementstmt 81.2% 26 / 32 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 50.0% 1 / 2 totaltotal 78.5% 33 / 42 CC 2 SCAR 3.7
CC
2
Cov
79%
new
2.1
TO_JSON
2.0
BEGIN
1.0
CRAP 1.4
« DeutscheBahn.pm ↑ Summary HAFAS/Services.pm »
1 package Travel::Status::DE::HAFAS::Message;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use parent 'Class::Accessor';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 our $VERSION = '6.15';
10  
11 5 Travel::Status::DE::HAFAS::Message->mk_ro_accessors(
12 qw(short type text code prio is_him ref_count));
13  
14 31 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod documented
15 31 my ( $obj, %conf ) = @_;
16  
17 31 my $json = $conf{json};
18 31 my $is_him = $conf{is_him};
19  
20 31 my $short = $json->{txtS};
21 31 my $text = $json->{txtN};
22 31 my $type = $json->{type};
23 31 my $code = $json->{code};
24 31 my $prio = $json->{prio};
25  
26 31 ▶ if ($is_him) {
Branch: 1 branch
BranchTrueFalseTotal
if ($is_him) 0 31 31
27 0 $short = $json->{head};
28 0 $text = $json->{text};
29 0 $code = $json->{hid};
30 }
31  
32 my $ref = {
33 short => $short,
34 text => $text,
35 type => $type,
36 code => $code,
37 prio => $prio,
38 is_him => $is_him,
39 ref_count => $conf{ref_count},
40 31 };
41  
42 31 bless( $ref, $obj );
43  
44 31 return $ref;
45 }
46  
47 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=1 SCAR=6.9
Pod undocumented
48 0 my ($self) = @_;
49  
50 0 return { %{$self} };
51 }
52  
53 5 1;
54  
55 __END__
« DeutscheBahn.pm ↑ Summary HAFAS/Services.pm »