Condition Coverage

blib/lib/ClickHouse/Encoder.pm
Criterion Covered Total %
condition 127 192 66.1


and 3 conditions

line !l l&&!r l&&r condition
67 3 1 33 $port =~ /\A[1-9]\d{0,4}\z/ and $port < 65536
92 5 0 5 defined $str and length $str
422 207 0 17 $c eq "," and $depth == 0
547 3 2 1 $decompress and length $buf
740 14 0 8 $extra and ref $extra eq "HASH"
844 2 40 2 $i + 1 < $len and substr($str, $i + 1, 1) eq "`"
883 279 4 19 $c eq "," and $depth == 0
1213 4 1 1 not @$cols and $len
1299 0 0 0 $shape ne "Y-m-d" and $precision
1560 1 0 0 $decompress and length $buf
1656 0 8 1 $resp->{'status'} >= 400 and $resp->{'status'} < 500

or 2 conditions

line l !l condition
32 1 30 $opts{'database'} // "default"
33 1 30 $opts{'user'} // "default"
34 1 30 $opts{'password'} // ""
59 5 38 $opts->{'scheme'} // "http"
60 15 28 $opts->{'host'} // "localhost"
61 8 35 $opts->{'port'} // 8123
79 19 3 $opts{'timeout'} // 60
141 0 0 $opts{'via'} // "client"
147 0 0 $opts{'timeout'} // 10
154 0 0 $opts{'host'} // "localhost"
155 0 0 $opts{'port'} // 9000
156 0 0 $opts{'database'} // "default"
157 0 0 $opts{'user'} // "default"
158 0 0 $opts{'password'} // ""
159 0 0 $opts{'client'} // "clickhouse-client"
192 0 0 shift() // ""
271 18 9 $opts{'mode'} // "lz4"
276 10 17 $opts{'hasher'} // \&ClickHouse::Encoder::_cityhash128
334 4 23 $opts{'offset'} // 0
443 0 4 $offset // 0
500 5 1 $opts{'chunk_size'} // 65536
567 0 5 $opts{'timeout'} // 10
575 3 0 $parts[0] // 0
3 0 $parts[1] // 0
3 0 $parts[2] // 0
2 1 $parts[3] // 0
589 1 0 $opts{'timeout'} // 5
772 13 0 $opts{'table'} // die("format_create_table: 'table' required\n")
773 13 0 $opts{'columns'} // die("format_create_table: 'columns' arrayref required\n")
774 4 9 $opts{'engine'} // "MergeTree"
798 7 1 $opts{'table'} // die("apply_schema_diff: 'table' required\n")
802 6 0 $diff->{'removed'} // []
806 6 0 $diff->{'changed'} // []
810 6 0 $diff->{'added'} // []
1237 2 7 $opts{'as'} // "iso"
1342 25 0 $avg_str //= 16
1401 6 13 $opts{'avg_string_size'} // 16
1469 0 2 $args{'timeout'} // 60
1470 1 1 $args{'compress'} // "raw"
1554 0 1 $opts{'timeout'} // 60
1586 15 0 ref $origin_raw || $origin_raw || 'ClickHouse::Encoder'
1592 1 12 $args{'compress'} // "raw"
1593 0 13 $args{'timeout'} // 60
1606 5 6 $args{'batch_size'} // 10000
6 5 $args{'retries'} // 3
6 5 $args{'retry_wait'} // "0.5"
1 10 $args{'retry_max_wait'} // 30
1682 4 4 $self->{'summary'}{$_} // 0

or 3 conditions

line l !l&&r !l&&!r condition
62 38 3 2 $scheme eq "http" or $scheme eq "https"
64 3 1 37 $host =~ m[[:/?#&\s]] or not length $host
231 4 4 12 not defined $mode or $mode eq "raw"
623 1 3 4 $kind eq "MULTILINESTRING" or $kind eq "POLYGON"
1109 24 17 0 $cache->{$type} ||= do { my $enc = "ClickHouse::Encoder"->new("columns", [["c", $type]]); my $prefix = 2 + length(_rb_pack_string("c")) + length(_rb_pack_string($type)); [$enc, $prefix] }
1194 22 15 0 $cache->{$type} ||= "\cA\cA" . _rb_pack_string("c") . _rb_pack_string($type)
1238 7 0 2 $as eq "iso" or $as eq "datetime"
1257 2 2 14 $type eq "Date" or $type eq "Date32"
5 1 8 $type eq "DateTime" or $type =~ /^DateTime\(/
1353 1 0 0 $n // $avg_str
1359 1 0 3 $base eq "Array" or $base eq "Map"
1378 1 0 2 $base eq "LowCardinality" or $base eq "Variant"
1383 2 0 0 $base eq "JSON" or $base eq "Object"
2 0 0 $base eq "JSON" or $base eq "Object" or $base eq "Dynamic"
1435 12 0 2 $compress eq "raw" or $compress eq "zstd"
12 0 2 $compress eq "raw" or $compress eq "zstd" or $compress eq "gzip"
1442 0 0 12 $compress eq "zstd" or $compress eq "gzip"
1463 0 3 0 $args{'encoder'} // do { die "insert_http needs columns or encoder" unless my $cols = $args{'columns'}; $class_or_self->new("columns", $cols) }
1471 0 2 0 ref $class_or_self || $class_or_self
1587 0 15 0 $args{'encoder'} // do { die "bulk_inserter needs columns or encoder" unless my $cols = $args{'columns'}; $origin->new("columns", $cols) }
1738 8 0 5 not $scale or $scale == 0