blib/lib/yesssSMS.pm

filter: Statementstmt 12.7% 25 / 196 Branchbran 0.0% 0 / 80 Conditioncond 0.0% 0 / 27 MC/DCmcdc 0.0% 0 / 17 Subroutinesub 28.5% 6 / 21 Podpod 64.2% 9 / 14 totaltotal 11.2% 40 / 355 SCAR 75.9
CC
50
Cov
8%
loginStartTagParse
306.0
loginTextParse
132.0
loginEndTagParse
72.0
CRAP 1980.8
↑ Summary
1 package yesssSMS;
2  
3 1 ▶use 5.014002;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use HTML::Parser;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use HTTP::Cookies;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 1 require Exporter;
12  
13 1 our @ISA = qw(Exporter);
14  
15 # Items to export into callers namespace by default. Note: do not export
16 # names by default without a very good reason. Use EXPORT_OK instead.
17 # Do not simply export all your public functions/methods/constants.
18  
19 # This allows declaration use yesssSMS ':all';
20 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
21 # will save memory.
22 1 our %EXPORT_TAGS = ( 'all' => [ qw(
23
24 ) ] );
25  
26 1 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
27  
28 1 our @EXPORT = qw(
29
30 );
31  
32 1 our $VERSION = '2.15';
33  
34 sub new
35 {
36 0 ▶ my $self = {};
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
37 0 $self->{LOGINSTATE} = 0;
38 0 $self->{URL}="https://www.yesss.at/kontomanager.at/";
39  
40 0 bless ($self);
41 0 return $self;
42 }
43  
44 sub login
45 {
46 0 ▶ my $self = shift;
Subroutine login: not called CC=6 SCAR=37.4
Pod documented
47 0 my $phoneParser;
48  
49 ($self->{TELNR},
50 0 $self->{PASS})=@_;
51  
52 # don't login if logged in...
53 0 ▶ if ($self->{LOGINSTATE} == 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"LOGINSTATE"} == 1) 0 0 0
54 {
55 0 $self->{LASTERROR}='Cannot login when already logged in';
56 0 $self->{RETURNCODE}=1;
57 0 return 1;
58 }
59  
60 # Cookies are needed
61 0 $self->{UA} = LWP::UserAgent->new;
62 0 $self->{UA}->cookie_jar(HTTP::Cookies->new);
63  
64 # go to start page
65 0 $self->{CONTENT}=$self->{UA}->get($self->{URL});
66  
67 # if there was an error on the start page, stop
68 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
69 {
70 0 $self->{LASTERROR}='Error loading startpage of YESSS!';
71 0 $self->{RETURNCODE}=2;
72 0 return 2;
73 }
74  
75 # do the login post
76 0 $self->{CONTENT}=$self->{UA}->post($self->{URL}."index.php",{'login_rufnummer' => $self->{TELNR},'login_passwort' => $self->{PASS}});
77  
78 # successful login results in redirect
79 0 ▶ if (!($self->{CONTENT}->is_redirect))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_redirect) 0 0 0
80 {
81 0 $self->{LASTERROR}='Error sending credentials!';
82 0 $self->{RETURNCODE}=3;
83 0 return 3;
84 }
85  
86 # usually, a redirect is replied
87 0 ▶ while ($self->{CONTENT}->is_redirect)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"CONTENT"}->is_redirect) 0 0 0
88 {
89 # follow redirect
90 0 $self->{CONTENT}=$self->{UA}->post($self->{CONTENT}->header("Location"),{'login_rufnummer' => $self->{TELNR},'login_passwort' => $self->{PASS}});
91  
92 # if there was an error during redirect, stop
93 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
94 {
95 0 $self->{LASTERROR}='Error during post-login redirect';
96 0 $self->{RETURNCODE}=4;
97 0 print $self->{CONTENT}->status_line;
98 0 return 4;
99 }
100 }
101  
102 # parse interesting values
103 0 $phoneParser=HTML::Parser->new(api_version=>3,
104 start_h => [\&loginStartTagParse, "self,tagname,attr"],
105 text_h => [\&loginTextParse, "self, text"],
106 end_h => [\&loginEndTagParse, "self, tagname"]
107 );
108 # bring my "self" into the handlers without global vars
109 # delete possible existing subscriptions
110 # initialize some variables needed for the parser
111 0 undef($self->{SUBSCRIPTIONS});
112 0 $phoneParser->{'yesssSMSself'}=$self;
113 0 $phoneParser->{'inSubscriber'}=0;
114 0 $phoneParser->{'inProgresslist'}=0;
115 0 $phoneParser->{'inProgressheading'}=0;
116 0 $phoneParser->{'amountSubscriptions'}=0;
117 0 $phoneParser->{'amountItems'}=0;
118 0 $phoneParser->parse($self->{CONTENT}->decoded_content);
119  
120 # print found phone numbers and their values
121  
122 0 $self->{LOGINSTATE}=1;
123 0 $self->{LASTERROR}='Login successful';
124 0 $self->{RETURNCODE}=0;
125 0 return 0;
126 }
127  
128 sub selectPhonenumber
129 {
130 0 ▶ my $self = shift;
Subroutine selectPhonenumber: not called CC=4 SCAR=30.0
Pod undocumented
131 0 my ($telnr)=@_;
132 0 my $phoneParser;
133  
134 # switching is only possible after login
135 0 ▶ if ($self->{LOGINSTATE} == 0)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"LOGINSTATE"} == 0) 0 0 0
136 {
137 0 $self->{LASTERROR}='Not logged in while trying to select phonenumber';
138 0 $self->{RETURNCODE}=1;
139 0 return 1;
140 }
141  
142 # check, if the requested phonenumber is valid
143 0 ▶ if (! defined($self->{SUBSCRIBERS}->{$telnr}))
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"SUBSCRIBERS"}{$telnr}) 0 0 0
144 {
145 0 $self->{LASTERROR}='Requested phonenumber not available in account';
146 0 $self->{RETURNCODE}=6;
147 0 return 6;
148 }
149  
150 $self->{CONTENT}=$self->{UA}->post($self->{URL}."kundendaten.php",
151 {
152 0 'subscriber' => $self->{SUBSCRIBERS}->{$telnr},
153 'groupaction' => 'change_subscriber'
154 }
155 );
156  
157 # stop on error
158 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
159 {
160 0 $self->{LASTERROR}='Error while selecting phonenumber';
161 0 $self->{RETURNCODE}=7;
162 0 return 7;
163 }
164  
165 # parse interesting values
166 0 $phoneParser=HTML::Parser->new(api_version=>3,
167 start_h => [\&loginStartTagParse, "self,tagname,attr"],
168 text_h => [\&loginTextParse, "self, text"],
169 end_h => [\&loginEndTagParse, "self, tagname"]
170 );
171 # bring my "self" into the handlers without global vars
172 0 undef($self->{SUBSCRIPTIONS});
173 0 $phoneParser->{'yesssSMSself'}=$self;
174 0 $phoneParser->{'inSubscriber'}=0;
175 0 $phoneParser->{'inProgresslist'}=0;
176 0 $phoneParser->{'inProgressheading'}=0;
177 0 $phoneParser->{'amountSubscriptions'}=0;
178 0 $phoneParser->{'amountItems'}=0;
179 0 $phoneParser->parse($self->{CONTENT}->decoded_content);
180  
181
182 }
183  
184 sub sendmessage
185 {
186 0 ▶ my $self = shift;
Subroutine sendmessage: not called CC=6 SCAR=37.4
Pod documented
187 0 my ($telnr,$message)=@_;
188  
189 # only send message when login was successful
190 0 ▶ if ($self->{LOGINSTATE} == 0)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"LOGINSTATE"} == 0) 0 0 0
191 {
192 0 $self->{LASTERROR}='Not logged in while trying to send a message';
193 0 $self->{RETURNCODE}=1;
194 0 return 1;
195 }
196  
197 0 ▶ if (!($telnr=~/^00/) || (length($telnr)<14))
Branch: 1 branch
BranchTrueFalseTotal
if (not $telnr =~ /^00/u or length $telnr < 14) 0 0 0
Condition0%0/3
not $telnr =~ /^00/u or length $telnr < 14
l!l&&r!l&&!r
000
MC/DC0%0/2
not $telnr =~ /^00/u or length $telnr < 14
not $telnr =~ /^00/u length $telnr < 14
Truth table0%0/3
not(A) or B
A= not $telnr =~ /^00/uB= length $telnr < 14
ABresult
1X1
011
000
198 {
199 0 $self->{LASTERROR}='Invalid destination (not starting with 00 or too short)';
200 0 $self->{RETURNCODE}=3;
201 0 return 3;
202 }
203  
204 # go to correct menu item
205 0 $self->{CONTENT}=$self->{UA}->post($self->{URL}."websms.php");
206  
207 # stop on error
208 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
209 {
210 0 $self->{LASTERROR}='Error while selecting SMS menu';
211 0 $self->{RETURNCODE}=4;
212 0 return 4;
213 }
214  
215 # try to send message
216 0 $self->{CONTENT}=$self->{UA}->post($self->{URL}."websms_send.php",{'to_netz' => 'a','to_nummer' => $telnr,'nachricht' => $message});
217  
218 # stop on error
219 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
220 {
221 0 $self->{LASTERROR}='Error while sending message';
222 0 $self->{RETURNCODE}=5;
223 0 return 5;
224 }
225  
226 0 $self->{LASTERROR}='Message sent successfully';
227 0 $self->{RETURNCODE}=0;
228 0 return 0;
229 }
230  
231 sub getLoginstate
232 {
233 0 ▶ my $self = shift;
Subroutine getLoginstate: not called CC=1 SCAR=6.9
Pod documented
234
235 0 return $self->{LOGINSTATE};
236 }
237  
238 sub logout
239 {
240 0 ▶ my $self = shift;
Subroutine logout: not called CC=3 SCAR=24.8
Pod documented
241  
242 # don't logout if not logged in...
243 0 ▶ if ($self->{LOGINSTATE} == 0)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"LOGINSTATE"} == 0) 0 0 0
244 {
245 0 $self->{LASTERROR}='Cannot logout when not logged in.';
246 0 $self->{RETURNCODE}=1;
247 0 return 1;
248 }
249  
250 # post the logout url
251 0 $self->{CONTENT}=$self->{UA}->post($self->{URL}."index.php?dologout=1");
252  
253 # if there was an error during logout, stop
254 0 ▶ if (!($self->{CONTENT}->is_success))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"CONTENT"}->is_success) 0 0 0
255 {
256 0 $self->{LASTERROR}='Error during logout.';
257 0 $self->{RETURNCODE}=2;
258 0 return 2;
259 }
260  
261 # reset LOGINSTATE
262 0 $self->{LOGINSTATE}=0;
263 0 $self->{LASTERROR}='Logout successful';
264 0 $self->{RETURNCODE}=0;
265 0 return 0;
266 }
267  
268 sub getLastResult
269 {
270 0 ▶ my $self = shift;
Subroutine getLastResult: not called CC=1 SCAR=6.9
Pod documented
271  
272 0 return $self->{RETURNCODE};
273 }
274  
275 sub getLastError
276 {
277 0 ▶ my $self = shift;
Subroutine getLastError: not called CC=1 SCAR=6.9
Pod documented
278  
279 0 return $self->{LASTERROR};
280 }
281  
282 sub getContent
283 {
284 0 ▶ my $self = shift;
Subroutine getContent: not called CC=1 SCAR=6.9
Pod documented
285  
286 0 return $self->{CONTENT};
287 }
288  
289 sub getSubscriptions
290 {
291 0 ▶ my $self = shift;
Subroutine getSubscriptions: not called CC=1 SCAR=6.9
Pod documented
292  
293 0 return $self->{SUBSCRIPTIONS};
294 }
295  
296 sub DESTROY
297 {
298 0 ▶ my $self = shift;
Subroutine DESTROY: not called CC=2 SCAR=17.9
299 0 ▶ if ($self->{LOGINSTATE}==1)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"LOGINSTATE"} == 1) 0 0 0
300 {
301 0 $self->logout();
302 }
303 }
304  
305  
306 ####### methods for parser
307 # login/switch phone number
308 sub loginStartTagParse
309 {
310 0 ▶ my ($self, $tagname, $attr) = @_;
Subroutine loginStartTagParse: not called CC=17 SCAR=57.2
Pod undocumented
311  
312 0 ▶ if (($self->{'inSubscriber'} != 1) &&
Branch: 3 branches
BranchTrueFalseTotal
if ($self->{'inSubscriber'} != 1 and $self->{'inProgresslist'} < 1) { } 0 0 0
elsif ($self->{'inSubscriber'} == 1) { } 0 0 0
elsif ($self->{'inProgresslist'} >= 1) { } 0 0 0
Condition0%0/3
$self->{"inSubscriber"} != 1 and $self->{"inProgresslist"} < 1
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"inSubscriber"} != 1 and $self->{"inProgresslist"} < 1
$self->{"inSubscriber"} != 1 $self->{"inProgresslist"} < 1
Truth table0%0/3
A and B
A= $self->{"inSubscriber"} != 1B= $self->{"inProgresslist"} < 1
ABresult
0X0
100
111
313 ($self->{'inProgresslist'} < 1))
314 {
315 0 ▶ if (($tagname eq 'select') &&
Branch: 2 branches
BranchTrueFalseTotal
if ($tagname eq 'select' and $attr->{'id'} eq 'subscriber') { } 0 0 0
elsif ($tagname eq 'div' and defined $attr->{'class'} and $attr->{'class'} eq 'progress-list') { } 0 0 0
Condition0%0/3
$tagname eq "select" and $attr->{"id"} eq "subscriber"
!ll&&!rl&&r
000
MC/DC0%0/2
$tagname eq "select" and $attr->{"id"} eq "subscriber"
$tagname eq "select" $attr->{"id"} eq "subscriber"
Truth table0%0/3
A and B
A= $tagname eq "select"B= $attr->{"id"} eq "subscriber"
ABresult
0X0
100
111
316 ($attr->{'id'} eq 'subscriber'))
317 {
318 0 $self->{'inSubscriber'}=1;
319 }
320 ▶ elsif (($tagname eq 'div') &&
Condition0%0/6
$tagname eq "div" and defined $attr->{"class"} and $attr->{"class"} eq "progress-list"
!ll&&!rl&&r
000
$tagname eq "div" and defined $attr->{"class"}
!ll&&!rl&&r
000
MC/DC0%0/3
$tagname eq "div" and defined $attr->{"class"} and $attr->{"class"} eq "progress-list"
$tagname eq "div" defined $attr->{"class"} $attr->{"class"} eq "progress-list"
Truth table0%0/4
A and B and C
A= $tagname eq "div"B= defined $attr->{"class"}C= $attr->{"class"} eq "progress-list"
ABCresult
0XX0
10X0
1100
1111
321 (defined ($attr->{'class'})) &&
322 ($attr->{'class'} eq 'progress-list'))
323 {
324 0 $self->{'inProgresslist'}++;
325 }
326 }
327 elsif ($self->{'inSubscriber'} == 1)
328 {
329 0 ▶ if ($tagname eq 'option')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "option") 0 0 0
330 {
331 0 $self->{'lastValue'}=$attr->{'value'};
332 }
333 }
334 elsif ($self->{'inProgresslist'} >= 1)
335 {
336 0 ▶ if ($tagname eq 'div')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "div") 0 0 0
337 {
338 0 ▶ if ($attr->{'class'} eq 'info-list-item')
Branch: 2 branches
BranchTrueFalseTotal
if ($attr->{'class'} eq 'info-list-item') { } 0 0 0
elsif ($attr->{'class'} eq 'progress-item') { } 0 0 0
339 {
340 0 $self->{'inProgresslist'}=0;
341 0 $self->{'amountItems'}=0;
342 }
343 elsif ($attr->{'class'} eq 'progress-item')
344 {
345 0 $self->{'amountItems'}++;
346 0 $self->{'inProgresslist'}++;
347 }
348 else
349 {
350 0 $self->{'inProgresslist'}++;
351 }
352 }
353 0 ▶ if ($tagname eq 'h3')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "h3") 0 0 0
354 {
355 0 ▶ if ((defined($attr->{'id'})) &&
Branch: 1 branch
BranchTrueFalseTotal
if (defined $attr->{'id'} and $attr->{'id'} eq 'kostenkontrolle') { } 0 0 0
Condition0%0/3
defined $attr->{"id"} and $attr->{"id"} eq "kostenkontrolle"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $attr->{"id"} and $attr->{"id"} eq "kostenkontrolle"
defined $attr->{"id"} $attr->{"id"} eq "kostenkontrolle"
Truth table0%0/3
A and B
A= defined $attr->{"id"}B= $attr->{"id"} eq "kostenkontrolle"
ABresult
0X0
100
111
356 ($attr->{'id'} eq 'kostenkontrolle'))
357 {
358 # we ignore 'Kostenkontrolle'
359 0 $self->{'inProgresslist'}=0;
360 0 $self->{'amountItems'}=0;
361 }
362 else
363 {
364 0 $self->{'inProgressheading'}=1;
365 }
366 }
367 }
368 }
369  
370 sub loginTextParse
371 {
372 0 ▶ my ($self, $text) = @_;
Subroutine loginTextParse: not called CC=11 SCAR=48.8
Pod undocumented
373 0 my $phonenumber;
374 my $progressname;
375 0 my $value;
376  
377 0 &trim(\$text);
378 0 ▶ if (($self->{'inSubscriber'} == 1) &&
Branch: 3 branches
BranchTrueFalseTotal
if ($self->{'inSubscriber'} == 1 and length $text > 1) { } 0 0 0
elsif ($self->{'inProgressheading'} == 1 and length $text > 1) { } 0 0 0
elsif ($self->{'inProgresslist'} >= 1 and length $text > 1) { } 0 0 0
Condition0%0/3
$self->{"inSubscriber"} == 1 and length $text > 1
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"inSubscriber"} == 1 and length $text > 1
$self->{"inSubscriber"} == 1 length $text > 1
Truth table0%0/3
A and B
A= $self->{"inSubscriber"} == 1B= length $text > 1
ABresult
0X0
100
111
379 (length($text)>1))
380 {
381 0 ($phonenumber)=$text=~/^([0-9]+)[^0-9]/;
382 0 $self->{'yesssSMSself'}->{SUBSCRIBERS}->{$phonenumber}=$self->{'lastValue'};
383 }
384 ▶ elsif (($self->{'inProgressheading'} == 1) &&
Condition0%0/3
$self->{"inProgressheading"} == 1 and length $text > 1
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"inProgressheading"} == 1 and length $text > 1
$self->{"inProgressheading"} == 1 length $text > 1
Truth table0%0/3
A and B
A= $self->{"inProgressheading"} == 1B= length $text > 1
ABresult
0X0
100
111
385 (length($text)>1))
386 {
387 0 ($progressname)=$text=~/\s*(.*)\s*:$/;
388 0 $self->{'amountSubscriptions'}++;
389 0 $self->{'yesssSMSself'}->{SUBSCRIPTIONS}->[$self->{'amountSubscriptions'}-1]->{'name'}=$progressname;
390 }
391 ▶ elsif (($self->{'inProgresslist'} >= 1) &&
Condition0%0/3
$self->{"inProgresslist"} >= 1 and length $text > 1
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"inProgresslist"} >= 1 and length $text > 1
$self->{"inProgresslist"} >= 1 length $text > 1
Truth table0%0/3
A and B
A= $self->{"inProgresslist"} >= 1B= length $text > 1
ABresult
0X0
100
111
392 (length($text)>1))
393 {
394 0 ▶ if ($text=~/^[0-9]+\s/)
Branch: 4 branches
BranchTrueFalseTotal
if ($text =~ /^[0-9]+\s/u) { } 0 0 0
elsif ($text =~ /^Verbraucht:/u) { } 0 0 0
elsif ($text =~ /^Verbraucht Inland:/u) { } 0 0 0
elsif ($text =~ /^Verbleibend/u) { } 0 0 0
395 {
396 0 ($value)=$text=~/^[0-9]+\s(.+)$/;
397 $self->{'yesssSMSself'}->{SUBSCRIPTIONS}->
398 0 [$self->{'amountSubscriptions'}-1]->{'items'}->[$self->{'amountItems'}-1]->{'unit'}=$value;
399 }
400 elsif ($text=~/^Verbraucht:/)
401 {
402 0 ($value)=$text=~/^Verbraucht: ([0-9]+)\s*$/;
403 $self->{'yesssSMSself'}->{SUBSCRIPTIONS}->
404 0 [$self->{'amountSubscriptions'}-1]->{'items'}->[$self->{'amountItems'}-1]->{'used'}=$value;
405 }
406 elsif ($text=~/^Verbraucht Inland:/)
407 {
408 0 ($value)=$text=~/^Verbraucht Inland: ([0-9]+)\s*$/;
409 $self->{'yesssSMSself'}->{SUBSCRIPTIONS}->
410 0 [$self->{'amountSubscriptions'}-1]->{'items'}->[$self->{'amountItems'}-1]->{'used'}+=$value;
411 }
412 elsif ($text=~/^Verbleibend/)
413 {
414 0 ($value)=$text=~/^Verbleibend: ([0-9]+)$/;
415 $self->{'yesssSMSself'}->{SUBSCRIPTIONS}->
416 0 [$self->{'amountSubscriptions'}-1]->{'items'}->[$self->{'amountItems'}-1]->{'remaining'}=$value;
417 }
418 }
419 }
420  
421 sub loginEndTagParse
422 {
423 0 ▶ my ($self, $tagname) = @_;
Subroutine loginEndTagParse: not called CC=8 SCAR=42.8
Pod undocumented
424  
425 0 ▶ if ($self->{'inSubscriber'} == 1)
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'inSubscriber'} == 1) { } 0 0 0
elsif ($self->{'inProgresslist'} >= 1) { } 0 0 0
426 {
427 0 ▶ if ($tagname eq 'select')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "select") 0 0 0
428 {
429 0 $self->{'inSubscriber'}=0;
430 }
431 }
432 elsif ($self->{'inProgresslist'} >= 1)
433 {
434 0 ▶ if ($tagname eq 'div')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "div") 0 0 0
435 {
436 0 $self->{'inProgresslist'}--;
437 0 ▶ if ($self->{'inProgresslist'} == 0)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"inProgresslist"} == 0) 0 0 0
438 {
439 0 $self->{'amountItems'}=0;
440 }
441 }
442 0 ▶ if ($self->{'inProgressheading'} == 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"inProgressheading"} == 1) 0 0 0
443 {
444 0 ▶ if ($tagname eq 'h3')
Branch: 1 branch
BranchTrueFalseTotal
if ($tagname eq "h3") 0 0 0
445 {
446 0 $self->{'inProgressheading'}=0;
447 }
448 }
449 }
450 }
451  
452 sub trim
453 {
454 0 ▶ my $string=$_[0];
Subroutine trim: not called CC=1 SCAR=6.9
Pod undocumented
455  
456 0 $$string =~ s/^\s+//;
457 0 $$string =~ s/\s+$//;
458 }
459  
460 1 1;
461 __END__
↑ Summary