Branch Coverage

blib/lib/GraphQL/Client/CLI.pm
Criterion Covered Total %
branch 30 140 21.4


line true false branch
27 0 0 unless ref $self
30 0 0 if (my $err = $@)
35 0 0 if ($options->{'version'})
39 0 0 if ($options->{'help'})
42 0 0 if ($options->{'manual'})
47 0 0 unless ($url)
63 0 0 if (my $err = $@)
64 0 0 if $ENV{'GRAPHQL_CLIENT_DEBUG'}
70 0 0 if ($query eq "-")
71 0 0 if -t STDIN
79 0 0 if $err
80 0 0 $unpack ? :
82 0 0 if ($outfile)
83 0 0 unless open my $out, ">", $outfile
87 0 0 if (my $filter = $options->{'filter'})
88 0 0 unless eval { do { require JSON::Path::Evaluator } }
90 0 0 if (@values == 1) { }
101 0 0 $unpack && $err ? :
111 0 5 if grep {/\P{ASCII}/;} @args
132 0 5 unless &GetOptionsFromArray(\@args, "version", \$options{'version'}, "help|h|?", \$options{'help'}, "manual|man", \$options{'manual'}, "url|u=s", \$options{'url'}, "query|mutation=s", \$options{'query'}, "variables|vars|V=s", \$options{'variables'}, "variable|var|d=s%", \$options{'variables'}, "operation-name|n=s", \$options{'operation_name'}, "transport|t=s%", \$options{'transport'}, "format|f=s", \$options{'format'}, "filter|p=s", \$options{'filter'}, "unpack!", \$options{'unpack'}, "output|o=s", \$options{'outfile'})
134 2 3 unless $options{'url'}
135 1 4 unless $options{'query'}
140 0 5 if $@
141 1 4 if ref $transport eq "HASH" and %$transport
143 0 5 if (ref $options{'variables'}) { }
0 5 elsif ($options{'variables'}) { }
145 0 0 if $@
149 0 0 if $@
157 0 0 if (ref $item eq "ARRAY")
159 0 0 unless ref $first
162 0 0 if ref $item eq "HASH"
169 0 0 if ($format eq 'json' or $format eq 'json:pretty') { }
0 0 elsif ($format eq 'yaml') { }
0 0 elsif ($format eq 'csv' or $format eq 'tsv' or $format eq 'table') { }
0 0 elsif ($format eq 'string') { }
0 0 elsif ($format eq 'perl') { }
171 0 0 if $format eq "json:pretty"
175 0 0 unless eval { do { require YAML } }
179 0 0 $format eq 'tsv' ? :
183 0 0 if ref $data eq "HASH" and $data->{'data'}
188 0 0 if (ref $unpacked eq 'HASH') { }
0 0 elsif (ref $unpacked eq 'ARRAY') { }
189 0 0 if (keys %$unpacked == 1)
191 0 0 if (ref $val eq "ARRAY")
193 0 0 if ($first and ref $first eq 'HASH') { }
0 0 elsif ($first) { }
208 0 0 if ($first and ref $first eq 'HASH') { }
0 0 elsif ($first) { }
220 0 0 if (@columns) { }
221 0 0 if ($format eq 'table') { }
222 0 0 unless eval { do { require Text::Table::Any } }
231 0 0 unless eval { do { require Text::CSV } }
246 0 0 if (not ref $data) { }
0 0 elsif (ref $data eq 'ARRAY') { }
259 0 0 unless eval { do { require Data::Dumper } }
276 4 19 if ($segment =~ /\[([^\.\]]+)\]/) { }
277 4 0 if @path
284 9 10 if @path
306 4 8 $type eq 'ARRAY' ? :
9 12 $type eq 'HASH' ? :
307 17 4 if (ref $curr eq 'HASH') { }
4 0 elsif (ref $curr eq 'ARRAY') { }
308 0 17 if $segment->{'index'}
309 4 13 if (defined $curr->{$name}) { }
310 2 2 if $type ne ref $curr->{$name}
318 0 4 unless $segment->{'index'}
319 0 4 if (defined $curr->[$name]) { }
320 0 0 if $type ne ref $curr->[$name]
339 0 0 if ($@) { }
340 0 0 $VERSION eq '999.999' ? :