Branch Coverage

File:blib/lib/Database/BI/Controller/Dashboard.pm
Coverage:72.0%

line%coveragebranch
13750TFif $per_page < 1
13850TFif $per_page > $MAX_PER_PAGE
14050TFif $page < 1
185100TFunless $url =~ m(\Ahttps?://([^/:?\[\]#]+))iu
189100TFif $host eq "localhost" or $host =~ /\A127\./u or $host eq "0.0.0.0" or $host eq "::1"
197100TFunless $host =~ /\A\d{1,3}(?:\.\d{1,3}){3}\z/u
199100TFunless my $packed = inet_aton($host)
202100TFif ($n & 4278190080) == 167772160
203100TFif ($n & 4293918720) == 2886729728
204100TFif ($n & 4294901760) == 3232235520
205100TFif ($n & 4294901760) == 2851995648
206100TFif ($n & 4290772992) == 1681915904
224100TFunless defined $url and length $url
225100TFif $url =~ m[\A(?:/(?!/)|https?://)]iu
26850TF$info->is_tablet ? :
100TF$info->is_mobile ? :
442100TFif $cols
443100TFunless $records->[0]
446100TF$c && $all{$c} ? :
488100TFunless length($col // "") and defined $op and length $op
493100TF$op eq 'notempty' ? :
100TF$op eq 'empty' ? :
100TF$op eq 'ge' ? :
100TF$op eq 'gt' ? :
100TF$op eq 'le' ? :
100TF$op eq 'lt' ? :
100TF$op eq 'starts' ? :
100TF$op eq 'contains' ? :
100TF$op eq 'ne' ? :
100TF$op eq 'eq' ? :
547100TFunless $seen{$key}++
589100TFunless $is_sql
59650TFunless length($col // "") and defined $op and length $op
600100TFif (exists $criteria{$col})
605100TFif ($op eq 'eq' or $op eq 'ne') { }
100TFelsif ($op eq 'contains') { }
100TFelsif ($op eq 'starts') { }
50TFelsif ($op eq 'lt') { }
50TFelsif ($op eq 'le') { }
100TFelsif ($op eq 'gt') { }
50TFelsif ($op eq 'ge') { }
606100TFif ($val =~ /[%_]/u) { }
609100TF$op eq 'eq' ? :
61450TFif ($val =~ /[%_]/u) { }
62050TFif ($val =~ /[%_]/u) { }
6270TF&Scalar::Util::looks_like_number($val) ? :
6310TF&Scalar::Util::looks_like_number($val) ? :
635100TF&Scalar::Util::looks_like_number($val) ? :
6390TF&Scalar::Util::looks_like_number($val) ? :
662100TFdefined $col ? :
674100TFunless defined $v and length $v
677100TFif $is_acct_neg and $n =~ /\A\d/u
678100TFunless $n =~ /\A-?\d+(?:\.\d+)?\z/u
69850TFunless $source and $source->can("aggregate")
699100TFif $fn eq "count" or $fn eq "count_distinct"
70050TFunless defined $col
715100TFunless defined $v and length $v
716100TFunless &Scalar::Util::looks_like_number($v)
72950TFunless defined $str and length $str
73150TFunless defined $fn and defined $as and length $fn and length $as
733100TFunless $MEASURE_FN_OK{$fn}
994100TFunless $seen{$col}++
1005100TF$has_col{$_} ? :
1023100TF$f =~ /[,"\r\n]/u ? :
145050TFunless defined $s
145150TFunless utf8::is_utf8($s)
1638100TFunless (defined $table and $table =~ /$TABLE_NAME_RE/u)
164450TF$self->param('d') ? :
1649100TFif ($source and $source->sqlite_tables and @{$source->sqlite_tables;} > 1) { }
1658100TFif ($@)
1669100TFif ($is_multi)
1755100TFunless defined $dir and -d $dir
177450TFunless length $name
1777100TFif $parent->to_string eq $f->to_string
178350TF$parent->to_string ne $dir->to_string ? :
1876100TFunless defined $file_path
188150TFif ($file_path =~ /$REDIS_URL_RE/u)
188650TFif ($file_path =~ /$REDIS_SPEC_RE/u)
18890TFunless $source
18910TF$self->param('d') ? :
18970TFif ($@)
1945100TFif ($file_path =~ m[\A/\.\./]u)
1948100TFunless $source
195150TF$self->param('d') ? :
195750TFif ($@)
2004100TFunless defined $file and -f $file and $file->basename =~ /$EXT_RE/u
2017100TFif ($back_override)
2020100TF$back_override ? :
2022100TF$self->param('d') ? :
2025100TFdefined $it ? :
2028100TFif (not defined $it and $source and $source->sqlite_tables and @{$source->sqlite_tables;} > 1) { }
2036100TFif ($@)
2040100TFif ($filename =~ /\.(?:sql|db)\z/iu)
2060100TFif ($is_multi_local)
2071100TFdefined $it ? :
100TFdefined $it ? :
2142100TFunless $idx =~ /\A[0-9]+\z/u
2155100TFunless length $url
2156100TFunless $url =~ m[\Ahttps?://]iu
2158100TFunless _is_safe_url($url)
2162100TFif $@ or not $source
2165100TFif $@
217150TF$self->param('d') ? :
217250TFif $dedup
217550TFif $idx
2251100TFunless (defined $table_name or defined $path)
2253100TFif ($spec =~ /\Atable:([A-Za-z_][A-Za-z0-9_]*)\z/u) { }
100TFelsif ($spec =~ /\Apath:(.+)\z/su) { }
2261100TFif (defined $table_name and $table_name =~ /$TABLE_NAME_RE/u) { }
100TFelsif (defined $path) { }
2264100TFunless grep {-f $data_dir->child(lc($table_name) . ".$_");} @SUPPORTED_EXT
2268100TFif ($path =~ m[\A/\.\./([^/]+)((?:/.+)?)/([^/]+)\z]u) { }
227050TFunless length $dir_part
227150TFif ($host =~ /$REMOTE_HOST_RE/u)
227250TF$file =~ /\A(.+)\.([^.]+)\z/u ? :
227350TFdefined $ext ? :
2278100TFif (defined $file and -f $file and $file->basename =~ /$EXT_RE/u)
2286100TFunless $source
228950TF$source->columns ? :
2351100TFunless $left_src
236050TFunless $join_type =~ /\A(?:left|inner|outer)\z/u
236550TFunless defined $right_spec and defined $left_key and defined $right_key
236850TFunless $cur_cols
236950TFunless {map({$_, 1;} @$cur_cols)}->{$left_key}
2372100TFunless $right_src
237550TFunless $right_cols
237650TFunless {map({$_, 1;} @$right_cols)}->{$right_key}
2380100TF$left_key ne $right_key ? :
50TF$right_label ? :
239350TF$self->param('d') ? :
2395100TF($self->param('dir') // 'asc') =~ /\Adesc\z/iu ? :
240450TFif ($@)
241750TFif (defined $sort and not grep({$_ eq $sort;} @columns))
2424100TFif @summaries
2516100TFunless $left_src
251950TFif ($@)
2539100TFunless $csrc
254150TFif $@
2547100TF@sources > 1 ? :
255650TF$self->param('d') ? :
255750TFif $dedup
2561100TF($self->param('dir') // 'asc') =~ /\Adesc\z/iu ? :
2562100TFif (defined $sort and grep {$_ eq $sort;} @columns) { }
50TFelsif (defined $sort) { }
2565100TFif $dir eq "desc"
2573100TF$total > $offset + $per_page ? :
2580100TFif @summaries
2675100TFunless $records
268150TFif (@$warnings)
2689100TF$format eq 'json' ? :
100TF$format eq 'sqlite' ? :
2770100TFunless (defined $dest_dir and -d $dest_dir)
2780100TFif ($filename and $filename =~ /\.csv\z/iu) { }
100TFelsif ($filename and $filename =~ /\.sql\z/iu) { }
50TFelsif ($filename and $filename =~ /\.json\z/iu) { }
2791100TFunless $records
2796100TFif ($format eq 'csv') { }
50TFelsif ($format eq 'json') { }
2806100TFif $@
2857100TFunless defined $dir and -d $dir
2867100TF$parent->to_string ne $dir->to_string ? :
2923100TFunless (defined $path and length $path)
2933100TFunless defined $file and -f $file and $file->basename =~ /$EXT_RE/u
2942100TFif ($file->basename =~ /\.(?:sql|sqlite|sqlite3|db)\z/iu)
2958100TFdefined $table_count ? :
3029100TFunless ($upload and $upload->filename)
3041100TFif ($self->req->is_limit_exceeded or $upload->size > $MAX_UPLOAD_BYTES)
3051100TFunless ($filename and $filename =~ /$EXT_RE/u)
3063100TFunless -d $uploads_base
3074100TFunless ($ok and -f $dest)
309150TFunless -d $uploads_dir
310050TFif (-d $entry) { }
0TFelsif (-f $entry) { }
310350TFunless -f $file
3140100TFunless length $x_col and length $y_col
3144100TFunless defined $records
314850TFif ($@)
3157100TFunless $col_set{$x_col}
3159100TFunless $col_set{$y_col}
3160100TFif (length $series_col)
3162100TFunless $col_set{$series_col}
3166100TFif (length $series_col)
317350TFunless length $x and length $y and length $grp
317550TFunless defined $yn
3176100TFunless (exists $by_series{$grp})
318350TFunless @series_order
319550TFunless utf8::is_utf8($html)
3206100TFunless length $x and length $y
3208100TFunless defined $yn
3209100TFif $_ ne $x_col
3213100TFunless @pairs
3226100TFif (not $ENV{'BI_FORCE_PERL_AGG'} and $src and not $has_filter and _measure_pushable($src, "avg", $y_col, $records))
323850TFif (not $@ and $ref and @$ref)
3245100TFunless (defined $min_y)
325950TFunless utf8::is_utf8($graph_html)
326250TF$back2 ? :
50TF$back2 ? :
3283100TF$self->param('donut') ? :
3288100TFunless length $cat_col and length $val_col
3292100TFunless defined $records
329650TFif ($@)
3305100TFunless $col_set{$cat_col}
331050TFunless $count_mode or $col_set{$val_col}
3316100TFunless ($count_mode)
331950TFunless length $v
3320100TFif ($v =~ /\A\s*\(?\s*([^\d\s.,\-\(])/u)
3328100TF$count_mode ? :
100TF$count_mode ? :
334050TFif ($topn_n > 0 and @$agg_rows > $topn_n)
33470TFif (@$other_rec)
33480TF$count_mode ? :
0TF$count_mode ? :
33540TFif @$other and defined $other->[0]{'value'}
3359100TFunless @$agg_rows
3370100TF$count_mode ? :
338250TFunless utf8::is_utf8($pie_html)
338550TF$back2 ? :
50TF$back2 ? :
346250TF$self->param('show_val') ? :
3467100TFunless length $x_col and length $y_col
3471100TFunless defined $records
347550TFif ($@)
3484100TFunless $col_set{$x_col}
3486100TFunless $col_set{$y_col}
348850TFif length $val_col and not $col_set{$val_col}
349850TFunless length $x and length $y
3499100TFunless $seen_x{$x}++
3500100TFunless $seen_y{$y}++
3504100TFlength $val_col ? :
100TFlength $val_col ? :
3525100TFunless @triples
3533100TFlength $val_col ? :
3535100TFlength $val_col ? :
354650TFunless utf8::is_utf8($heatmap_html)
354950TF$back2 ? :
50TF$back2 ? :
3628100TFunless length $cat_col
3632100TFunless defined $records
363650TFif ($@)
3645100TFunless $col_set{$cat_col}
3650100TFunless $count_mode or $col_set{$val_col}
3653100TF$count_mode ? :
100TF$count_mode ? :
3665100TFif ($topn_n > 0 and @$agg_rows > $topn_n)
367250TFif (@$other_rec)
367350TF$count_mode ? :
50TF$count_mode ? :
367950TFif @$other and defined $other->[0]{'value'}
3684100TFunless @$agg_rows
3691100TF$orient eq 'h' ? :
3692100TF$sort eq 'value' || $sort eq 'label' ? :
3697100TF$count_mode ? :
3699100TF$count_mode ? :
50TF$max_bars > 0 ? :
371250TFunless utf8::is_utf8($bar_html)
371550TF$back2 ? :
50TF$back2 ? :
3798100TFunless length $left_spec
3803100TFif length $prefix > $MAX_PREFIX_LEN
3812100TFunless $records
3817100TFunless (length $key_col)
381850TF$#{$records;} < 9 ? :
3821100TFif (($row->{$col} // "") =~ /\A[A-Z]{1,4}\d+[A-Z]?\z/u)
3836100TFunless defined $p
3848100TFif length $p <= $len
3849100TFif substr($p, 0, $len) ne $par
3860100TFif substr($p, 0, length $par) eq $par
387150TFif length $key_col
3875100TFif (not length $prefix) { }
3893100TF$i < length $prefix ? :
391850TFunless ($an // 0) <=> ($bn // 0)
3922100TFlength $prefix ? :
3970100TFunless defined $spec and length $spec
3975100TFif ($spec =~ /\Atable:([A-Za-z0-9_]+)\z/u) { }
100TFelsif ($spec =~ /\Apath:(.+)\z/u) { }
50TFelsif ($spec =~ /$REDIS_URL_RE/u) { }
3981100TFif (-f $p)
3986100TFunless defined $file_path
3993100TFunless defined $file and -f $file and $file->basename =~ /\.(?:sql|sqlite|sqlite3|db)\z/iu
40030TFif ($spec =~ m[\Aredis://(?::([^\@]*)@)?([^/]+)(?:/(\d+))?\z]iu)
40180TFif (eval {         do {         require "$file.pm"; 1 } })
40200TFunless $pkg
40280TFif defined $password and length $password
40290TFif defined $db_idx and int $db_idx > 0
40480TFif $@
405350TFif (defined $file_path)
406550TFif ($sth)
407850TFif $@
411350TFunless length $left_spec
4121100TFunless length $rows_str
4125100TFunless @measure_strs
4137100TFunless $m
4144100TF$self->param('totals') // '' ? :
415150TFunless defined $records
4159100TFif ($@)
417250TFunless $col_set{$dim}
4176100TFunless defined $m->{'col'} and length $m->{'col'}
418050TFunless $col_set{$m->{'col'}}
4194100TFdefined $m->{'col'} && length $m->{'col'} ? :
4204100TFunless ($row_seen{$rkey}++)
4208100TFunless ($col_seen{$ckey}++)
422150TFif (@h_specs)
42340TFif defined $cv
42410TFunless @$passed
42430TFif $ok
4256100TFif ($topn_n > 0 and @row_key_order > $topn_n)
4258100TFif (length $topn_col and not $m_aliases{$topn_col})
426450TFlength $topn_col ? :
427650TFif (@rest_rkeys) { }
428450TFif (@$other_rec) { }
428850TFdefined $m->{'col'} && length $m->{'col'} ? :
4314100TFif ($show_totals)
431650TFdefined $m->{'col'} && length $m->{'col'} ? :
4331100TFif (@cols)
435150TFif @$gtot
435950TFif ($max_cols_n > 0 and @col_key_order > $max_cols_n)
43690TF$show_totals ? :
0TF$show_totals ? :
43740TFif (@rest_ckeys) { }
43820TFif (defined $cv)
43840TF$have ? :
4396100TFif ($format and $format =~ /\A(?:csv|sqlite|sql|json|xlsx)\z/u)
440850TFif $format eq "csv"
44100TFif $format eq "sqlite" or $format eq "sql"
44120TFif $format eq "json"
44140TFif ($format eq "xlsx")
44170TFunless open my $fh, ">", \$out
4444100TF$total_row_groups > $offset + $per_page ? :
4445100TF$piv_has_next ? :
100TF$offset < $total_row_groups ? :
4473100TF$show_totals ? :
448050TF$back2 ? :
50TF$back2 ? :
4522100TFunless length $left_spec
453050TFunless defined $records
453450TFif ($@)
454650TFif defined $_->{$col}
4560100TFif (@nums)
456850TF@sorted % 2 ? :
4573100TFdefined $min_val ? :
459050TFCORE::index($back, '?') != -1 ? :
50TF$back2 ? :
50TF$back2 ? :
4617100TFunless length $spec
4619100TFunless $name =~ /\A[A-Za-z_][A-Za-z0-9_]*\z/u
4623100TFunless length $expr
463650TFunless length $spec
4647100TFunless length $spec
466450TFunless length $spec
466650TFunless length $col
466850TFunless length $group_name
468250TFunless length $spec
468650TFif (length $col and length $group_name) { }
50TFelsif (length $col) { }
469950TFunless length $spec
4718100TFunless length $spec
472050TFunless length $col
4725100TFunless $ALLOWED_DATE_PATTERNS{$pattern}
473950TFunless length $spec
4743100TFif (length $col) { }
4756100TFunless length $spec
4774100TFunless length $x_col
4775100TFunless length $y_col
477850TFunless defined $records
478150TFif ($@)
478850TFunless $col_set{$x_col}
478950TFunless $col_set{$y_col}
479550TFunless defined $xv and defined $yv
4797100TFif $_ ne $x_col
480150TFunless @points
481850TFunless utf8::is_utf8($scatter_html)
482150TF$back2 ? :
50TF$back2 ? :
4851100TFunless length $cat_col
4852100TFunless length $seg_col
485550TFunless defined $records
485850TFif ($@)
486550TFunless $col_set{$cat_col}
486650TFunless $col_set{$seg_col}
487050TFunless $count_mode or $col_set{$val_col}
487750TFunless length $cat and length $seg
4878100TFunless $cat_seen{$cat}++
4880100TFif ($count_mode) { }
488450TFif defined $v
489550TFunless @data
4903100TF$count_mode ? :
490550TF$orient eq 'h' ? :
491250TFunless utf8::is_utf8($stacked_html)
491550TF$back2 ? :
50TF$back2 ? :
4944100TFunless length $x_col
4945100TFunless length $bar_col
4946100TFunless length $line_col
494950TFunless defined $records
495250TFif ($@)
495950TFunless $col_set{$x_col}
496050TFunless $col_set{$bar_col}
496150TFunless $col_set{$line_col}
496750TFunless length $xv
496850TFunless $x_seen{$xv}++
498150TFunless @data
499950TFunless utf8::is_utf8($combo_html)
500250TF$back2 ? :
50TF$back2 ? :
5029100TFunless length $cat_col
503250TFunless defined $records
503550TFif ($@)
504250TFunless $col_set{$cat_col}
50460TFunless $count_mode or $col_set{$val_col}
504850TF$count_mode ? :
50TF$count_mode ? :
506050TFif ($topn_n > 0 and @$agg_rows > $topn_n)
50670TFif (@$other_rec)
50680TF$count_mode ? :
0TF$count_mode ? :
50740TFif @$other and defined $other->[0]{'value'}
507950TFunless @$agg_rows
509150TF$count_mode ? :
509850TFunless utf8::is_utf8($treemap_html)
510150TF$back2 ? :
50TF$back2 ? :
5129100TFunless length $col
513250TFunless defined $records
513550TFif ($@)
514250TFunless $col_set{$col}
5147100TFif defined $v
5150100TFunless @values
515650TFif $bins < 1
515750TFif $bins > 200
517050TFunless utf8::is_utf8($histogram_html)
517350TF$back2 ? :
50TF$back2 ? :