TFTPd/Client.pm

filter: Statementstmt 77.2% 17 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 1 / 1 totaltotal 75.8% 22 / 29 CC 1 SCAR 1.7
CC
1
Cov
77%
new
2.0
__ANON__
1.1
BEGIN
1.0
CRAP 1.2
« TFTPd.pm ↑ Summary
1 package POE::Component::TFTPd::Client;
2  
3 =head1 NAME
4  
5 POE::Component::TFTPd::Client
6  
7 =head1 VERSION
8  
9 See L<POE::Component::TFTPd>
10  
11 =cut
12  
13 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use POE::Component::TFTPd;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 3 my %defaults = (
18 id => undef,
19 address => undef,
20 port => undef,
21 retries => 0,
22 timestamp => 0,
23 last_block => 0,
24 block_size => 0,
25 rrq => 0,
26 wrq => 0,
27 filename => q(),
28 mode => q(),
29 rfc => [], # remember to override in new!
30 almost_done => 0,
31 resent_block => 0,
32 );
33  
34 =head1 METHODS
35  
36 =head2 new
37  
38 =cut
39  
40 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
41 0 my $class = shift;
42 0 my $tftpd = shift;
43 0 my $client = shift;
44  
45 return bless {
46 %defaults,
47 id => join(":", $client->{'addr'}, $client->{'port'}),
48 address => $client->{'addr'},
49 0 port => $client->{'port'},
50 block_size => POE::Component::TFTPd::TFTP_MIN_BLKSIZE(),
51 retries => $tftpd->retries,
52 rfc => [],
53 }, $class;
54 }
55  
56 =head2 id
57  
58 =head2 address
59  
60 =head2 port
61  
62 =head2 retries
63  
64 =head2 timestamp
65  
66 =head2 last_block
67  
68 =head2 block_size
69  
70 =head2 rrq
71  
72 =head2 wrq
73  
74 =head2 filename
75  
76 =head2 mode
77  
78 =head2 rfc
79  
80 =head2 almost_done
81  
82 =head2 resent_block
83  
84 =cut
85  
86 {
87 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
88 3 for my $sub (keys %defaults) {
89 0 ▶ *$sub = sub :lvalue { shift->{$sub} };
Subroutine __ANON__: not called CC=1 SCAR=1.2
90 }
91 }
92  
93 =head1 AUTHOR
94  
95 =head1 ACKNOWLEDGEMENTS
96  
97 =head1 COPYRIGHT & LICENSE
98  
99 See L<POE::Component::TFTPd>
100  
101 =cut
102  
103 3 1;
« TFTPd.pm ↑ Summary