Branch Coverage

lib/WWW/Workflowy.pm
Criterion Covered Total %
branch 106 202 52.4


line true false branch
160 0 27 if $method eq 'DESTROY'
163 0 27 $method =~ /^[\$\@\%\&\*]/ ? :
173 9 18 if ($stash and $stash->can($method))
180 0 18 unless exists $$closed_over{$attr}
184 0 18 if (@_)
185 0 0 if $ref eq 'ARRAY'
186 0 0 if $ref eq 'HASH'
190 0 18 $ref eq 'HASH' || $ref eq 'ARRAY' ? :
226 0 3 if ($args{'guid'} and not $args{'url'}) { }
0 3 elsif ($args{'url'} and $args{'url'} =~ m[workflowy.com/s/\w+$]) { }
1 2 elsif (not $args{'guid'} and $args{'url'}) { }
0 2 elsif ($args{'guid'} and $args{'url'}) { }
2 0 elsif ($args{'outline'}) { }
0 0 elsif ($args{'username'} and $args{'password'}) { }
232 0 1 unless ($args{'guid'}) = $args{'url'} =~ m[/shared/(.*?)/\w*$]
238 0 2 unless $last_transaction_id = $$outline{'initialMostRecentOperationTransactionId'}
256 0 3 if keys %args
261 3 0 unless $user_agent->cookie_jar
265 0 3 if ($username and $password)
290 0 0 if ($response->is_error)
298 0 0 if ($response->code == 301 or $response->code == 302)
299 0 0 unless my $location = $response->header('Location')
301 0 0 if ($location eq 'https://workflowy.com/accounts/login')
322 1 0 if ($shared_projectid) { }
0 0 elsif ($share_id) { }
339 0 1 if ($response->is_error)
343 0 1 unless my $decoded_content = $response->decoded_content
345 0 1 unless my $response_json = decode_json($decoded_content)
349 0 1 unless $client_id = $$response_json{'projectTreeData'}{'clientId'}
353 0 1 unless $last_transaction_id = $$outline{'initialMostRecentOperationTransactionId'}
355 0 1 unless $date_joined = $$outline{'dateJoinedTimestampInSeconds'}
356 0 1 unless $$outline{'initialPollingIntervalInMs'}
364 1 2 unless $outline
377 0 5 unless my $parent_id = $args{'parent_id'} || $args{'parent_node'}{'id'}
378 0 5 unless my $new_node = $args{'new_node'}
379 0 5 unless defined $priority
380 0 5 unless my($parent_node, $children) = _find_node($outline, $parent_id)
381 1 4 unless ($children)
382 0 1 if ($parent_id eq $shared_projectid) { }
389 2 3 if $priority > $#$children
397 0 4 unless my $node = $args{'node'}
398 0 4 unless exists $args{'text'}
407 0 2 if $args{'node'} and not $node_id
408 0 2 unless $node_id
422 0 1 unless my $node_id = $args{'node_id'}
423 0 1 unless my $parent_id = $args{'parent_id'}
424 0 1 unless defined $priority
426 0 1 unless my $node = _find_node($outline, $node_id)
456 0 3 if keys %args
462 1 2 if ($cmd eq 'edit') { }
0 2 elsif ($cmd eq 'move') { }
1 1 elsif ($cmd eq 'create') { }
1 0 elsif ($cmd eq 'delete') { }
464 0 1 unless my $node = _find_node($outline, $node_id)
485 0 0 unless my $node = _find_node($outline, $node_id)
512 0 1 unless my($parent, $children) = _find_node($outline, $parent_id)
556 1 0 $parent_node ? :
583 0 3 unless $$run_ops{'ops'}
589 3 4 if ($type eq 'create') { }
3 1 elsif ($type eq 'edit') { }
0 1 elsif ($type eq 'delete') { }
1 0 elsif ($type eq 'move') { }
600 0 3 if $parent_id eq 'None'
632 0 1 unless $last_transaction_id
640 0 1 if ($share_id) { }
658 0 1 if ($response->is_error)
673 0 1 if $$result_json{'results'}[0]{'error'}
675 0 1 unless $last_transaction_id = $$result_json{'results'}[0]{'new_most_recent_operation_transaction_id'}
706 0 4 unless $outline
707 0 4 unless $shared_projectid
709 1 3 if ($action eq 'edit')
711 0 1 unless my $save_id = delete $args{'save_id'}
712 0 1 unless my $text = delete $args{'text'}
725 0 3 if ($action eq 'move')
728 0 0 unless my $node_id = delete $args{'node_id'}
729 0 0 unless my($parent_node, $node, $previous_priority, $siblings) = _find_parent($outline, $node_id)
744 1 2 if ($action eq 'create')
762 1 1 if ($action eq 'delete')
764 0 1 unless my $node_id = delete $args{'node_id'}
775 1 0 if ($action eq 'sync')
777 0 1 if (time - $last_poll_time < $polling_interval)
786 0 0 if ($action eq 'fetch' or $action eq 'read' or $action eq 'get')
798 0 1 ref $_[0] ? :
805 0 5 unless my $cb = shift()
813 0 0 unless my $id = shift()
819 0 22 unless my $cb = shift()
834 0 70 unless my $cb = shift()
838 20 117 if &$cb($child, $stack, $position)
839 48 69 if ($$child{'ch'})
841 28 20 if $node
856 11 31 if ($$child{'id'} eq $node_id)
864 6 5 wantarray ? :
886 6 20 if ($$child{'id'} eq $node_id)
888 6 0 @parent_nodes ? :
898 1 5 if $$parent_node{'fake'}
900 6 0 wantarray ? :
906 0 0 unless my $node_id = shift()
907 0 0 unless my(undef, $children) = _find_node($self->outline, $node_id)
912 0 2 unless my $arr = shift()
913 0 2 unless my $node_id = shift()
915 2 3 if ($$arr[$i]{'id'} eq $node_id)