Open/Broadcast.pm

filter: Statementstmt 100% 44 / 44 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 58 / 58 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Open/AudioFragment.pm ↑ Summary Open/DayGuide.pm »
1 # -*- cperl; cperl-indent-level: 4 -*-
2 # Copyright (C) 2011-2021, Roland van Ipenburg
3 package WWW::NOS::Open::Broadcast v1.0.5;
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use 5.014000;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use Moose qw/around has with/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Moose::Util::TypeConstraints qw/enum/;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use namespace::autoclean '-also' => qr/^__/sxm;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 4 ▶use WWW::NOS::Open::TypeDef qw(NOSDateTime NOSURI);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 Readonly::Scalar my $UNDER => q{_};
18 4 Readonly::Scalar my $GETTER => q{get};
19 4 Readonly::Array my @TV_CHANNEL_CODES => qw(NL1 NL2 NL3);
20 4 Readonly::Array my @RADIO_CHANNEL_CODES => qw(RA1 RA2 RA3 RA4 RA5 RA6);
21  
22 4 has '_id' => (
23 'is' => 'ro',
24 'isa' => 'Int',
25 'reader' => 'get_id',
26 'init_arg' => 'id',
27 );
28  
29 4 has '_channel_icon' => (
30 'is' => 'ro',
31 'isa' => NOSURI,
32 'coerce' => 1,
33 'reader' => 'get_channel_icon',
34 'init_arg' => 'channel_icon',
35 );
36  
37 4 my @dates = qw(starttime endtime);
38 4 ▶while ( my $date = shift @dates ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $date = shift @dates) 8 4 12
39 8 has $UNDER
40 . $date => (
41 'is' => 'ro',
42 'isa' => NOSDateTime,
43 'coerce' => 1,
44 'reader' => $GETTER . $UNDER . $date,
45 'init_arg' => $date,
46 );
47 }
48  
49 4 has '_channel_code' => (
50 'is' => 'ro',
51 'isa' => enum( [ @TV_CHANNEL_CODES, @RADIO_CHANNEL_CODES ] ),
52 'reader' => 'get_channel_code',
53 'init_arg' => 'channel_code',
54 );
55  
56 4 my @strings = qw(type channel_name genre title description);
57 4 ▶while ( my $string = shift @strings ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $string = shift @strings) 20 4 24
58 20 has $UNDER
59 . $string => (
60 'is' => 'ro',
61 'isa' => 'Str',
62 'reader' => $GETTER . $UNDER . $string,
63 'init_arg' => $string,
64 );
65 }
66  
67 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 4 __PACKAGE__->meta->make_immutable;
70  
71 4 1;
72  
73 __END__
« Open/AudioFragment.pm ↑ Summary Open/DayGuide.pm »