Branch Coverage

blib/lib/StorageDisplay/Collect.pm
Criterion Covered Total %
branch 21 386 5.4


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 10 16 unless exists $info->{$entry}
112 10 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)
348 0 0 unless ($s =~ m[^[0-9a-zA-Z_\@,:/=-]+$])
377 0 0 unless open $dh, "<", $filename
399 0 0 unless open my $dh, "-|", @cmd
406 0 0 if ($> != 0) { }
426 0 0 unless open my $dh, "-|", @cmd
433 0 0 if ($> != 0) { }
451 0 0 unless (exists $args{'recorder-reader'})
455 0 0 if (ref $reader eq "")
459 0 0 unless &blessed($reader) and $reader->isa("StorageDisplay::Collect::CMD")
489 0 0 if (scalar @infos)
616 0 0 wantarray ? :
752 0 0 if ($line eq '') { }
753 0 0 if (defined $dname) { }
754 0 0 if (exists $data->{'names'})
765 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]: .*$/) { }
780 0 0 defined $dname ? :
785 0 0 if (defined $dname)
822 0 0 if $line eq "No devices found"
823 0 0 if ($line =~ /^DM_/)
824 0 0 if (defined $dname) { }
832 0 0 if ($line =~ /^ ?(DM_[^=]*)='(.*)'$/) { }
833 0 0 if ($2 ne "")
836 0 0 if ($1 eq "DM_BLKDEVNAME")
840 0 0 defined $dname ? :
843 0 0 if (defined $dname)
872 0 0 unless defined $udev_info
873 0 0 if (($udev_info->{'_udev_infos'}{'DEVTYPE'} // "") ne "disk")
876 0 0 if (($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} // "") eq "")
877 0 0 if (($lsblk_info->{'rm'} // 0) == 1)
881 0 0 if (($lsblk_info->{'type'} // "") eq "loop" and ($lsblk_info->{'size'} // 0) == 0)
886 0 0 if (($lsblk_info->{'type'} // "") eq "lvm")
894 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")
919 0 0 if (($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} // "") eq "")
930 0 0 if ($startline ne "")
934 0 0 unless ($line =~ /;$/)
939 0 0 if ($state == 0) { }
0 0 elsif ($state == 1) { }
0 0 elsif ($state == 2) { }
940 0 0 if ($line eq "BYT;")
945 0 0 if ($line =~ /.*:([0-9]+)B:[^:]*:[0-9]+:[0-9]+:([^:]*):(.*):;/)
953 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:[^:]*:(.*):([^:]*);$/) { }
969 0 0 if ($multiline)
971 0 0 if ($label =~ /^Project-Id.*Content-Transfer-Encoding: 8bit$/)
982 0 0 if ($state != 2)
986 0 0 if ($udev_info->{'_udev_infos'}{'ID_PART_TABLE_TYPE'} eq "dos")
991 0 0 if ($line =~ /^\s([1234]) .* extended( .*)?$/)
1033 0 0 if (scalar @$keys == 1) { }
0 0 elsif (scalar @$keys > 1) { }
1050 0 0 if ($uniq) { }
1051 0 0 if defined $h->{$k}
1127 0 0 if ($line =~ /([^ ]+) (partition|file) ([0-9]+) ([0-9]+)$/) { }
0 0 elsif ($line =~ /([^ ]+) ([^ ]+) ([0-9]+) ([0-9]+)$/) { }
1137 0 0 if ($2 eq "file")
1140 0 0 if defined $mountpoint
1174 0 0 if (exists $node->{'children'})
1185 0 0 if (exists $node->{'children'})
1219 0 0 unless defined $udev_info
1220 0 0 if (($udev_info->{'_udev_infos'}{'ID_FS_TYPE'} // "") ne "crypto_LUKS")
1251 0 0 if ($line =~ /^LUKS header information/) { }
0 0 elsif ($line =~ /^Version:\s*([^\s]*)$/) { }
1258 0 0 if ($luks_header)
1289 0 0 if $line =~ /^Personalities/
1290 0 0 if $line =~ /^unused devices/
1291 0 0 if $line =~ /^\s/
1312 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)?/) { }
1318 0 0 if ($1 eq "container")
1341 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*$/) { }
1388 0 0 if ($state == 0) { }
0 0 elsif ($state == 1) { }
0 0 elsif ($state == 2) { }
1389 0 0 if $line eq "SAS2IRCU: MPTLib2 Error 1"
1390 0 0 unless $line =~ /^[\s-]*-[\s-]*$/
1393 0 0 if ($line =~ /^SAS2IRCU:/) { }
0 0 elsif ($line =~ /^\s*([0-9]+)\s+/) { }
1394 0 0 if ($line ne "SAS2IRCU: Utility Completed Successfully.")
1407 0 0 if ($state != 2)
1408 0 0 if ($state != 0 or $nodata != 1)
1442 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:/) { }
1451 0 0 if ($line eq 'SAS2IRCU: Command DISPLAY Completed Successfully.' or $line eq 'SAS2IRCU: Utility Completed Successfully.') { }
1479 0 0 if $line =~ /^[\s-]*$/
1480 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].*)$/) { }
1489 0 0 if (exists $l->{$section})
1505 0 0 if (exists $l->{$section})
1531 0 0 if ($state != 0)
1537 0 0 if ($k =~ m(^PHY\[([^\]]+)\] Enclosure#/Slot#)) { }
0 0 elsif ($k eq 'Size (in MB)/(in sectors)') { }
1553 0 0 if ($k eq 'guid') { }
0 0 elsif ($k eq 'wwid') { }
1568 0 0 unless my $dh2 = $self->open_file($line)
1574 0 0 if (defined $wwid->{$addr})
1580 0 0 if (scalar @dirs != 1) { }
1615 0 0 unless $line =~ /^Controller Count:\s*([0-9]+)\.?\s*$/
1639 0 0 if (@$list)
1644 0 0 wantarray ? :
1662 0 0 if $line =~ /^\s*$/
1663 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!$/) { }
1665 0 0 if ($section_name =~ /Disk/)
1672 0 0 unless exists $megacli->{$idc}
1674 0 0 if (scalar @infos != scalar @headers)
1680 0 0 if ($section_name eq "Disk")
1683 0 0 if (exists $megacli->{$idc}{$section_name}{$id})
1706 0 0 unless (exists $megacli->{$dev}{'Disk'}{$slot_id})
1714 0 0 if $line =~ /^\s*$/
1715 0 0 if $line eq "Adapter #$dev"
1716 0 0 if ($line eq "^Adapter")
1720 0 0 if ($line =~ m[^Enclosure Device ID: *([0-9]+|N/A) *$])
1722 0 0 if $cur_enc eq "N/A"
1726 0 0 if ($line =~ /^Enclosure Device ID: *(.*) *$/)
1729 0 0 if ($line =~ /^Slot Number: *([0-9]+) *$/)
1730 0 0 if (defined $cur_slot or not defined $cur_enc)
1736 0 0 if ($line =~ /^Array *#: *([0-9]+) *$/)
1738 0 0 unless ($d->{'ID'} =~ /^c[0-9]+uXpY$/)
1745 0 0 if ($line =~ /^Coerced Size:.*\[(0x[0-9a-f]+) *Sectors\]/i)
1749 0 0 if ($line =~ /^Sector Size: *([0-9]+)$/i)
1751 0 0 $1 == 0 ? :
1781 0 0 if $line =~ /^\s*$/
1802 0 0 if ($line =~ /running/)
1811 0 0 if $line =~ /^[\s-]*$/
1813 0 0 if ($info[0] // "") eq "Type"
1815 0 0 if $info[3] eq "-"
1816 0 0 if (scalar @info != 4)
1826 0 0 if ($info[0] eq 'file') { }
0 0 elsif ($info[0] eq 'block') { }
1834 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.
1841 0 0 if ($curdisk ne "" and not $line =~ /^disk\.$curdisk\./)
1842 0 0 if (exists $curdiskinfo->{'name'} and exists $curdiskinfo->{'alias'})
1849 0 0 if $line =~ /^[\s-]*$/
1850 0 0 unless ($line =~ /^([^:\s]+)\s*: (.*)$/)
1855 0 0 if ($key eq "hostname")
1859 0 0 if ($key =~ /^disk\.([0-9]+)\./)
1861 0 0 if ($key =~ /\.(name|alias)$/)
1867 0 0 if ($curdisk ne "")
1906 0 0 if $line =~ /^NAME$/
1930 0 0 if ($filename =~ /(.*) \(deleted\)/)
1984 0 0 if (scalar @files == 0)
1993 0 0 if (scalar @files != scalar @res) { }
1997 0 0 if ($res[$i] =~ /^OK/) { }
2004 0 0 if (scalar @present > 0)