Branch Coverage

lib/WWW/Workflowy.pm
Criterion Covered Total %
branch 99 170 58.2


line true false branch
156 0 27 if $method eq 'DESTROY'
159 0 27 $method =~ /^[\$\@\%\&\*]/ ? :
169 9 18 if ($stash and $stash->can($method))
176 0 18 unless exists $$closed_over{$attr}
180 0 18 if (@_)
181 0 0 if $ref eq 'ARRAY'
182 0 0 if $ref eq 'HASH'
186 0 18 $ref eq 'HASH' || $ref eq 'ARRAY' ? :
220 0 3 if ($args{'guid'} and not $args{'url'}) { }
1 2 elsif (not $args{'guid'} and $args{'url'}) { }
0 2 elsif ($args{'guid'} and $args{'url'}) { }
2 0 elsif ($args{'outline'}) { }
224 0 1 unless ($args{'guid'}) = $args{'url'} =~ m[/shared/(.*?)/\w*$]
230 0 2 unless $last_transaction_id = $$outline{'initialMostRecentOperationTransactionId'}
241 0 3 if keys %args
246 3 0 unless $user_agent->cookie_jar
255 0 1 if ($response->is_error)
259 0 1 unless my $decoded_content = $response->decoded_content
261 0 1 unless my $response_json = decode_json($decoded_content)
263 0 1 unless $client_id = $$response_json{'projectTreeData'}{'clientId'}
267 0 1 unless $last_transaction_id = $$outline{'initialMostRecentOperationTransactionId'}
269 0 1 unless $date_joined = $$outline{'dateJoinedTimestampInSeconds'}
270 0 1 unless $$outline{'initialPollingIntervalInMs'}
278 1 2 unless $outline
291 0 5 unless my $parent_id = $args{'parent_id'} || $args{'parent_node'}{'id'}
292 0 5 unless my $new_node = $args{'new_node'}
293 0 5 unless defined $priority
294 0 5 unless my($parent_node, $children) = _find_node($outline, $parent_id)
295 1 4 unless ($children)
296 0 1 if ($parent_id eq $shared_projectid) { }
303 2 3 if $priority > $#$children
311 0 4 unless my $node = $args{'node'}
312 0 4 unless exists $args{'text'}
321 0 2 if $args{'node'} and not $node_id
322 0 2 unless $node_id
336 0 1 unless my $node_id = $args{'node_id'}
337 0 1 unless my $parent_id = $args{'parent_id'}
338 0 1 unless defined $priority
340 0 1 unless my $node = _find_node($outline, $node_id)
366 0 3 if keys %args
372 1 2 if ($cmd eq 'edit') { }
1 1 elsif ($cmd eq 'create') { }
1 0 elsif ($cmd eq 'delete') { }
374 0 1 unless my $node = _find_node($outline, $node_id)
398 0 1 unless my($parent, $children) = _find_node($outline, $parent_id)
442 1 0 $parent_node ? :
469 0 3 unless $$run_ops{'ops'}
475 3 4 if ($type eq 'create') { }
3 1 elsif ($type eq 'edit') { }
0 1 elsif ($type eq 'delete') { }
1 0 elsif ($type eq 'move') { }
486 0 3 if $parent_id eq 'None'
517 0 1 unless $last_transaction_id
537 0 1 if ($response->is_error)
552 0 1 if $$result_json{'results'}[0]{'error'}
554 0 1 unless $last_transaction_id = $$result_json{'results'}[0]{'new_most_recent_operation_transaction_id'}
585 0 4 unless $outline
586 0 4 unless $shared_projectid
588 1 3 if ($action eq 'edit')
590 0 1 unless my $save_id = delete $args{'save_id'}
591 0 1 unless my $text = delete $args{'text'}
602 1 2 if ($action eq 'create')
620 1 1 if ($action eq 'delete')
622 0 1 unless my $node_id = delete $args{'node_id'}
633 1 0 if ($action eq 'sync')
635 0 1 if (time - $last_poll_time < $polling_interval)
644 0 0 if ($action eq 'fetch' or $action eq 'read' or $action eq 'get')
662 0 5 unless my $cb = shift()
670 0 0 unless my $id = shift()
676 0 22 unless my $cb = shift()
691 0 68 unless my $cb = shift()
695 20 111 if &$cb($child, $stack, $position)
696 46 65 if ($$child{'ch'})
698 28 18 if $node
713 11 31 if ($$child{'id'} eq $node_id)
721 6 5 wantarray ? :
743 6 20 if ($$child{'id'} eq $node_id)
745 6 0 @parent_nodes ? :
755 1 5 if $$parent_node{'fake'}
757 6 0 wantarray ? :
763 0 0 unless my $node_id = shift()
764 0 0 unless my(undef, $children) = _find_node($self->outline, $node_id)
769 0 2 unless my $arr = shift()
770 0 2 unless my $node_id = shift()
772 2 3 if ($$arr[$i]{'id'} eq $node_id)