Branch Coverage

blib/lib/GraphQL/Client/CLI.pm
Criterion Covered Total %
branch 28 118 23.7


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
90 0 0 $unpack && $err ? :
100 0 3 if grep {/\P{ASCII}/;} @args
120 0 3 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'}, 'unpack!', \$options{'unpack'}, 'output|o=s', \$options{'outfile'})
122 2 1 unless $options{'url'}
123 1 2 unless $options{'query'}
128 0 3 if $@
130 0 3 if (ref $options{'variables'}) { }
0 3 elsif ($options{'variables'}) { }
132 0 0 if $@
136 0 0 if $@
144 0 0 if (ref $item eq 'ARRAY')
146 0 0 unless ref $first
149 0 0 if ref $item eq 'HASH'
156 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 'perl') { }
158 0 0 if $format eq 'json:pretty'
162 0 0 unless eval { do { require YAML } }
166 0 0 $format eq 'tsv' ? :
170 0 0 if $data and $data->{'data'}
175 0 0 if (keys %$unpacked == 1)
177 0 0 if (ref $val eq 'ARRAY')
179 0 0 if ($first and ref $first eq 'HASH') { }
0 0 elsif ($first) { }
192 0 0 if (@columns) { }
193 0 0 if ($format eq 'table') { }
194 0 0 unless eval { do { require Text::Table::Any } }
203 0 0 unless eval { do { require Text::CSV } }
218 0 0 unless eval { do { require Data::Dumper } }
235 4 15 if ($segment =~ /\[([^\.\]]+)\]/) { }
236 4 0 if @path
243 7 8 if @path
265 4 7 $type eq 'ARRAY' ? :
7 11 $type eq 'HASH' ? :
266 15 3 if (ref $curr eq 'HASH') { }
3 0 elsif (ref $curr eq 'ARRAY') { }
267 0 15 if $segment->{'index'}
268 3 12 if (defined $curr->{$name}) { }
269 2 1 if $type ne ref $curr->{$name}
277 0 3 unless $segment->{'index'}
278 0 3 if (defined $curr->[$name]) { }
279 0 0 if $type ne ref $curr->[$name]
298 0 0 if ($@) { }
299 0 0 $VERSION eq '999.999' ? :