Branch Coverage

blib/lib/StorageDisplay/Collect.pm
Criterion Covered Total %
branch 21 376 5.5


line true false branch
39 0 0 unless $collector->isa("StorageDisplay::Collect::Collector")
44 0 0 if (exists $self->{'_attr_collectors_by_provide'}{$cn})
83 0 0 if (ref $reader eq "")
111 8 14 unless exists $info->{$entry}
112 8 6 if (ref $info->{$entry} eq "")
142 0 0 if (not defined $state) { }
0 0 elsif ($collector_state->{$cname} == 1) { }
144 0 0 unless defined $collector
158 0 0 if (scalar @missing_files)
164 0 0 $col->depends('root') ? :
175 0 0 if (scalar @missing_progs)
235 1 1 unless (defined $has_boolean_values)
245 0 2 if ($has_boolean_values) { }
267 2 6 if (not $ref_type) { }
1 5 elsif ($ref_type eq 'HASH') { }
2 3 elsif ($ref_type eq 'ARRAY') { }
2 1 elsif ($ref_type eq 'JSON::PP::Boolean') { }
0 1 elsif ($ref_type eq 'Math::BigInt') { }
1 0 elsif ($ref_type eq 'Math::BigFloat') { }
277 1 1 $_[0] ? :
280 0 0 if ($_[0]->beq($_[0]->numify))
287 1 0 if ($_[0]->is_int and $_[0]->beq($_[0]->numify))
308 1 0 unless (defined $json_parser)
337 0 0 unless ($s =~ m[^[0-9a-zA-Z_\@,:/=-]+$])
366 0 0 unless open $dh, "<", $filename
388 0 0 unless open my $dh, "-|", @cmd
395 0 0 if ($> != 0) { }
415 0 0 unless open my $dh, "-|", @cmd
422 0 0 if ($> != 0) { }
440 0 0 unless (exists $args{'recorder-reader'})
444 0 0 if (ref $reader eq "")
448 0 0 unless &blessed($reader) and $reader->isa("StorageDisplay::Collect::CMD")
478 0 0 if (scalar @infos)
605 0 0 wantarray ? :
746 0 0 if ($line eq '') { }
747 0 0 if (defined $dname) { }
748 0 0 if (exists $data->{'names'})
759 0 0 if ($line =~ /^P: (.*)$/) { }
0 0 elsif ($line =~ /^N: (.*)$/) { }
0 0 elsif ($line =~ /^S: (.*)$/) { }
0 0 elsif ($line =~ /^E: (DEVLINKS)=(.*)$/) { }
0 0 elsif ($line =~ /^E: ([^=]*)=(.*)$/) { }
0 0 elsif ($line =~ /^[MRUTDILQV]: .*$/) { }
774 0 0 defined $dname ? :
779 0 0 if (defined $dname)
816 0 0 if $line eq "No devices found"
817 0 0 if ($line =~ /^DM_/)
818 0 0 if (defined $dname) { }
826 0 0 if ($line =~ /^ ?(DM_[^=]*)='(.*)'$/) { }
827 0 0 if ($2 ne "")
830 0 0 if ($1 eq "DM_BLKDEVNAME")
834 0 0 defined $dname ? :
837 0 0 if (defined $dname)
866 0 0 unless defined $udev_info
867 0 0 if (($udev_info->{'_udev_infos'}{'DEVTYPE'} // "") ne "disk")
870 0 0 if (($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} // "") eq "")
871 0 0 if (($lsblk_info->{'rm'} // 0) == 1)
875 0 0 if (($lsblk_info->{'type'} // "") eq "loop" and ($lsblk_info->{'size'} // 0) == 0)
880 0 0 if (($lsblk_info->{'type'} // "") eq "lvm")
888 0 0 if (($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} // "") eq "dos" and ($udev_info->{'_udev_infos'}{'ID_PART_ENTRY_NUMBER'} // "") ne "" and ($udev_info->{'_udev_infos'}{'DM_TYPE'} // "") eq "raid")
913 0 0 if (($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} // "") eq "")
924 0 0 if ($startline ne "")
928 0 0 unless ($line =~ /;$/)
933 0 0 if ($state == 0) { }
0 0 elsif ($state == 1) { }
0 0 elsif ($state == 2) { }
934 0 0 if ($line eq "BYT;")
939 0 0 if ($line =~ /.*:([0-9]+)B:[^:]*:[0-9]+:[0-9]+:([^:]*):(.*):;/)
947 0 0 if ($line =~ /^1:([0-9]+)B:[0-9]+B:([0-9]+)B:free;$/) { }
0 0 elsif ($line =~ /^([0-9]+):([0-9]+)B:[0-9]+B:([0-9]+)B:[^:]*:(.*):([^:]*);$/) { }
963 0 0 if ($multiline)
965 0 0 if ($label =~ /^Project-Id.*Content-Transfer-Encoding: 8bit$/)
976 0 0 if ($state != 2)
980 0 0 if ($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} eq "dos")
985 0 0 if ($line =~ /^\s([1234]) .* extended( .*)?$/)
1027 0 0 if (scalar @$keys == 1) { }
0 0 elsif (scalar @$keys > 1) { }
1044 0 0 if ($uniq) { }
1045 0 0 if defined $h->{$k}
1119 0 0 if ($line =~ /([^ ]+) (partition|file) ([0-9]+) ([0-9]+)$/) { }
0 0 elsif ($line =~ /([^ ]+) ([^ ]+) ([0-9]+) ([0-9]+)$/) { }
1128 0 0 if ($2 eq "file")
1131 0 0 if defined $mountpoint
1153 0 0 unless $line =~ m[^/]
1190 0 0 unless defined $udev_info
1191 0 0 if (($udev_info->{'_udev_infos'}{'ID_FS_TYPE'} // "") ne "crypto_LUKS")
1222 0 0 if ($line =~ /^LUKS header information/) { }
0 0 elsif ($line =~ /^Version:\s*([^\s]*)$/) { }
1229 0 0 if ($luks_header)
1260 0 0 if $line =~ /^Personalities/
1261 0 0 if $line =~ /^unused devices/
1262 0 0 if $line =~ /^\s/
1283 0 0 if ($line =~ /^\s*Array Size :\s*([0-9]+)\s*\(/) { }
0 0 elsif ($line =~ /^\s*Used Dev Size :\s*([0-9]+)\s*\(/) { }
0 0 elsif ($line =~ /^\s*Raid Level :\s*([^\s].*)/) { }
0 0 elsif ($line =~ /^\s*State : \s*([^\s].*)/) { }
0 0 elsif ($line =~ /^\s*Version : \s*([^\s].*)/) { }
0 0 elsif ($line =~ /^\s*Name : \s*([^\s]+)\s*/) { }
0 0 elsif ($line =~ /^\s*Member Arrays : \s*([^\s]+.*[^\s])\s*/) { }
0 0 elsif ($line =~ /^\s*Container : \s*([^\s]+), member ([0-9]+)\s*/) { }
0 0 elsif ($line =~ /^\s*Number\s*Major\s*Minor\s*RaidDevice(\s*State)?/) { }
1289 0 0 if ($1 eq "container")
1312 0 0 if (not $container and $line =~ /^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9-]+)\s+([^\s].*[^\s])\s+([^\s]+)$/) { }
0 0 elsif ($container and $line =~ /^\s*(-)\s+([0-9]+)\s+([0-9]+)\s+(-)\s+([^\s]+)$/) { }
0 0 elsif ($line =~ /^\s*$/) { }
1359 0 0 if ($state == 0) { }
0 0 elsif ($state == 1) { }
0 0 elsif ($state == 2) { }
1360 0 0 if $line eq "SAS2IRCU: MPTLib2 Error 1"
1361 0 0 unless $line =~ /^[\s-]*-[\s-]*$/
1364 0 0 if ($line =~ /^SAS2IRCU:/) { }
0 0 elsif ($line =~ /^\s*([0-9]+)\s+/) { }
1365 0 0 if ($line ne "SAS2IRCU: Utility Completed Successfully.")
1378 0 0 if ($state != 2)
1379 0 0 if ($state != 0 or $nodata != 1)
1413 0 0 if ($line eq 'Controller information') { }
0 0 elsif ($line eq 'IR Volume information') { }
0 0 elsif ($line eq 'Physical device information') { }
0 0 elsif ($line eq 'Enclosure information') { }
0 0 elsif ($line =~ /SAS2IRCU:/) { }
1422 0 0 if ($line eq 'SAS2IRCU: Command DISPLAY Completed Successfully.' or $line eq 'SAS2IRCU: Utility Completed Successfully.') { }
1450 0 0 if $line =~ /^[\s-]*$/
1451 0 0 if ($line =~ /^(Controller) information$/ or $line =~ /^(Enclosure) information$/) { }
0 0 elsif ($line =~ /^IR (Volume) information$/ or $line =~ /^Physical (device) information$/) { }
0 0 elsif ($line =~ /^IR volume ([^\s])+$/) { }
0 0 elsif ($line =~ /^Device is a Hard disk$/) { }
0 0 elsif ($line =~ /^Initiator at ID .*$/) { }
0 0 elsif ($line =~ /^SAS2IRCU: .* Completed Successfully.$/) { }
0 0 elsif ($line =~ /^[^\s]/) { }
0 0 elsif ($line =~ /^\s+([^\s][^:]*[^\s])\s*:\s+([^\s].*)$/) { }
1460 0 0 if (exists $l->{$section})
1476 0 0 if (exists $l->{$section})
1502 0 0 if ($state != 0)
1508 0 0 if ($k =~ m(^PHY\[([^\]]+)\] Enclosure#/Slot#)) { }
0 0 elsif ($k eq 'Size (in MB)/(in sectors)') { }
1524 0 0 if ($k eq 'guid') { }
0 0 elsif ($k eq 'wwid') { }
1539 0 0 unless my $dh2 = $self->open_file($line)
1545 0 0 if (defined $wwid->{$addr})
1551 0 0 if (scalar @dirs != 1) { }
1586 0 0 unless $line =~ /^Controller Count:\s*([0-9]+)\.?\s*$/
1610 0 0 if (@$list)
1615 0 0 wantarray ? :
1633 0 0 if $line =~ /^\s*$/
1634 0 0 if ($line =~ /^-- (.*) [Ii]nformation(s)?(\s*--)?\s*$/) { }
0 0 elsif ($line =~ /^--\s*(ID\s*|.*[^\s])\s*$/) { }
0 0 elsif ($line =~ /^(c([0-9]+)(\s|u).*[^\s])\s*$/) { }
0 0 elsif ($line =~ m[^There is at least one disk/array in a NOT OPTIMAL state.$]) { }
0 0 elsif ($line =~ /^RAID ERROR - Arrays: OK:[0-9]+ Bad:[0-9]+ - Disks: OK:[0-9]+ Bad:[0-9]+$/) { }
0 0 elsif ($line =~ /^No MegaRAID or PERC adapter detected on your system!$/) { }
1636 0 0 if ($section_name =~ /Disk/)
1643 0 0 unless exists $megacli->{$idc}
1645 0 0 if (scalar @infos != scalar @headers)
1651 0 0 if ($section_name eq "Disk")
1654 0 0 if (exists $megacli->{$idc}{$section_name}{$id})
1677 0 0 unless (exists $megacli->{$dev}{'Disk'}{$slot_id})
1685 0 0 if $line =~ /^\s*$/
1686 0 0 if $line eq "Adapter #$dev"
1687 0 0 if ($line eq "^Adapter")
1691 0 0 if ($line =~ m[^Enclosure Device ID: *([0-9]+|N/A) *$])
1693 0 0 if $cur_enc eq "N/A"
1697 0 0 if ($line =~ /^Enclosure Device ID: *(.*) *$/)
1700 0 0 if ($line =~ /^Slot Number: *([0-9]+) *$/)
1701 0 0 if (defined $cur_slot or not defined $cur_enc)
1707 0 0 if ($line =~ /^Array *#: *([0-9]+) *$/)
1709 0 0 unless ($d->{'ID'} =~ /^c[0-9]+uXpY$/)
1716 0 0 if ($line =~ /^Coerced Size:.*\[(0x[0-9a-f]+) *Sectors\]/i)
1720 0 0 if ($line =~ /^Sector Size: *([0-9]+)$/i)
1722 0 0 $1 == 0 ? :
1752 0 0 if $line =~ /^\s*$/
1773 0 0 if ($line =~ /running/)
1782 0 0 if $line =~ /^[\s-]*$/
1784 0 0 if ($info[0] // "") eq "Type"
1786 0 0 if $info[3] eq "-"
1787 0 0 if (scalar @info != 4)
1797 0 0 if ($info[0] eq 'file') { }
0 0 elsif ($info[0] eq 'block') { }
1800 0 0 if defined $mountpoint
1803 0 0 if (defined $mountpoint)
1816 0 0 if ($v->{'state'} // Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.26.1/B/Deparse.pm line 5018.
1823 0 0 if ($curdisk ne "" and not $line =~ /^disk\.$curdisk\./)
1824 0 0 if (exists $curdiskinfo->{'name'} and exists $curdiskinfo->{'alias'})
1831 0 0 if $line =~ /^[\s-]*$/
1832 0 0 unless ($line =~ /^([^:\s]+)\s*: (.*)$/)
1837 0 0 if ($key eq "hostname")
1841 0 0 if ($key =~ /^disk\.([0-9]+)\./)
1843 0 0 if ($key =~ /\.(name|alias)$/)
1849 0 0 if ($curdisk ne "")