Branch Coverage

blib/lib/FAQ/OMatic/Item.pm
Criterion Covered Total %
branch 1 338 0.3


line true false branch
52 0 1 if (FAQ::OMatic::I18N::language() eq 'ja_JP.EUC')
69 0 0 if ($arg and defined $$itemCache{$arg})
76 0 0 if ($arg) { }
78 0 0 if ($$item{'filename'})
93 0 0 unless defined $$item{'SequenceNumber'}
140 0 0 if (not $rc or -s "$dir/$filename" != 0)
155 0 0 if (not $filename =~ /^([\w\-.]*)$/) { }
166 0 0 unless ($dir)
170 0 0 unless (-f "$dir/$filename")
171 0 0 if ($dir eq ($FAQ::OMatic::Config::itemDir || 'x') and FAQ::OMatic::Versions::getVersion('Items'))
183 0 0 if (-s "$dir/$filename" == 0)
189 0 0 unless (open FILE, "$dir/$filename")
230 0 0 if defined $line
247 0 0 if ($key eq 'Part') { }
0 0 elsif ($key eq 'LastModified') { }
0 0 elsif ($key eq 'PermEditItem') { }
0 0 elsif ($key =~ /-Set$/) { }
0 0 elsif ($key ne '') { }
263 0 0 unless (defined $$self{$key})
308 0 0 unless $forsecs
313 0 0 if ($df eq '24') { }
318 0 0 if ($hr >= 12)
322 0 0 if $hr == 0
337 0 0 unless (defined $ampm)
342 0 0 if ($mo eq $monthMap[$month_i])
347 0 0 if ($month_i == 12)
350 0 0 if $hr == 12
351 0 0 if $ampm eq 'p'
378 0 0 unless $dir
383 0 0 if (not $filename) { }
390 0 0 if ($self->isBroken)
391 0 0 defined $filename ? :
395 0 0 if ($dir eq $FAQ::OMatic::Config::itemDir and not $noRecomputeDependencies)
421 0 0 if ($lastModified ne 'noChange')
426 0 0 if $lastModified eq ''
432 0 0 unless $lock
434 0 0 unless (open FILE, ">$dir/$filename")
442 0 0 if ($key =~ /^[a-z]/ or $key eq 'Parts') { }
0 0 elsif ($key =~ /-Set$/) { }
450 0 0 if (FAQ::OMatic::I18N::language() eq 'ja_JP.EUC')
460 0 0 if (FAQ::OMatic::I18N::language() eq 'ja_JP.EUC')
498 0 0 if ($dir eq $FAQ::OMatic::Config::itemDir)
512 0 0 if (scalar @result)
519 0 0 unless (chmod 0644, "$dir/$filename")
526 0 0 if ($lastModified)
533 0 0 if ($dir eq $FAQ::OMatic::Config::itemDir)
537 0 0 if ($$self{'titleChanged'})
553 0 0 if ($updateAllDependencies) { }
592 0 0 if ($what eq 'insert') { }
627 0 0 unless ($itemi->isBroken)
645 0 0 if (defined $dirPart)
682 0 0 if (defined $FAQ::OMatic::Config::cacheDir and -w $FAQ::OMatic::Config::cacheDir)
692 0 0 if (not open(CACHEFILE, ">$staticFilename")) { }
698 0 0 if (not chmod(0644, $staticFilename))
726 0 0 if ($key eq 'Parts') { }
743 0 0 if ($title) { }
750 0 0 unless $undefokay
795 0 0 if (($nextfile || '') ne '1')
809 0 0 unless $_
810 0 0 unless $_
824 0 0 if defined $nextfile and $nextfile eq $parentFile
843 0 0 if ($prevs)
846 0 0 if ($useTable) { }
852 0 0 if $useTable
859 0 0 if $useTable
861 0 0 if ($nexts)
864 0 0 if ($useTable) { }
870 0 0 if $useTable
877 0 0 if $useTable
914 0 0 if ($render ne 'text')
934 0 0 if (@parentFilenames)
936 0 0 if ($render ne 'text' and not $FAQ::OMatic::Config::nolanTitles || '')
943 0 0 if ($render eq 'text') { }
946 0 0 if ($FAQ::OMatic::Config::nolanTitles or '') { }
960 0 0 if (FAQ::OMatic::getParam($params, 'showModerator') eq 'show')
966 0 0 if (FAQ::OMatic::getParam($params, 'render') ne 'text') { }
969 0 0 unless $$self{'Moderator'}
981 0 0 $self->isCategory ? :
983 0 0 if (FAQ::OMatic::getParam($params, 'editCmds') ne 'hide')
986 0 0 if ($self->isCategory) { }
0 0 elsif ($self->isAnswer) { }
1043 0 0 if ($self->ordinaryItem)
1045 0 0 $whatAmI eq 'Answer' ? :
1060 0 0 if ($$self{'Parent'} ne $$self{'filename'})
1082 0 0 if ($self->isCategory and scalar $self->getChildren == 0) { }
0 0 elsif (not $self->isCategory) { }
1106 0 0 if ($self->isCategory)
1109 0 0 if (length $title > 15)
1134 0 0 if ($self->ordinaryItem)
1175 0 0 if ($render eq 'text') { }
1184 0 0 if (not $FAQ::OMatic::Config::hideEasyEdits and $render ne 'text')
1186 0 0 if ($self->isCategory) { }
1223 0 0 if ($attributionsTogether and $showAttributions eq 'default')
1237 0 0 if ($lastModified and $showLastModified)
1248 0 0 if ($$params{'recurse'} or $$params{'_recurse'})
1274 0 0 if ($$params{'recurse'} or $$params{'_recurse'})
1289 0 0 if (FAQ::OMatic::getParam($params, 'render') ne 'text' and not $FAQ::OMatic::Config::hideSiblings || '')
1293 0 0 if $useTable
1296 0 0 if $useTable
1297 0 0 unless $useTable
1309 0 0 if $$params{'file'} =~ /^help/
1313 0 0 if $$params{'recurse'}
1329 0 0 if (FAQ::OMatic::getParam($params, 'render') ne 'text') { }
1358 0 0 unless defined $curvalue
1364 0 0 if $$values[$i] eq $curvalue
1375 0 0 if ($perm =~ /^6 (.*)$/)
1395 0 0 if ($insertHint eq 'category') { }
0 0 elsif ($insertHint eq 'answer') { }
1400 0 0 if ($self->isCategory) { }
0 0 elsif ($self->isAnswer) { }
1445 0 0 if ($self->numParts > 1)
1457 0 0 if $$self{'AttributionsTogether'}
1527 0 0 if ($self->isCategory) { }
0 0 elsif ($self->isAnswer) { }
1581 0 0 unless (gettext('No'), gettext('Yes'))[shift()]
1618 0 0 unless (gettext('No'), gettext('Yes'))[shift()]
1630 0 0 if $$ph{'global'} and $$self{'filename'} ne '1'
1658 0 0 unless {'relax', gettext('Relax'), 'norelax', gettext(q[Don't Relax])}->{shift()}
1688 0 0 if ($self->getParent eq $self) { }
1694 0 0 if (defined $where) { }
1715 0 0 if (defined $value and $value ne '') { }
1717 0 0 if ($property eq 'Title')
1739 0 0 if (defined $$self{'directoryHint'}) { }
1752 0 0 if $self->getDirPart
1774 0 0 if ($subitem->isBroken)
1783 0 0 unless ($deferUpdate)
1797 0 0 unless (defined $dirPart)
1802 0 0 if ($subfilename)
1808 0 0 unless ($deferUpdate)
1872 0 0 if $encode_lang eq 'ja_JP.EUC'
1880 0 0 if ($amount >= length $string) { }
1892 0 0 if ($amount >= length $string) { }
1896 0 0 unless $mb = $string =~ s/^([\200-\377].)+// or $string =~ s/[\0-\177]+//
1899 0 0 if $mb
1903 0 0 if length $r
1923 0 0 unless ($FAQ::OMatic::Config::disableSearchHighlight or '')
1960 0 0 if (defined $i)
1969 0 0 if (length $parts[$i] < 20)
1976 0 0 $i - 1 >= 0 ? :
1977 0 0 $i + 1 < scalar @parts ? :
1980 0 0 $ltrunc ? :
0 0 $rtrunc ? :
2007 0 0 if $mail ne '1'
2010 0 0 unless $moderator =~ /\@/
2015 0 0 if ($id eq $moderator and $didWhat =~ /moderator options/)
2036 0 0 if (defined $changedPart)
2046 0 0 if (defined $moderator) { }
2067 0 0 if $mail ne '1'
2070 0 0 unless $moderator =~ /\@/
2075 0 0 if ($id eq $moderator and $didWhat =~ /moderator options/)
2096 0 0 if (defined $changedPart)
2106 0 0 if (defined $moderator) { }
2125 0 0 unless $parent
2129 0 0 if ($siblings[$i] eq $$self{'filename'})
2130 0 0 $i > 0 ? :
2131 0 0 $i < @siblings - 1 ? :
2140 0 0 defined $$self{'directoryHint'} ? :
2155 0 0 if $self->isCategory
2156 0 0 if $self->isAnswer
2170 0 0 if ($self->getPart($i)->{'Type'} eq 'directory')
2187 0 0 if $key eq 'Parts'
2188 0 0 if ($key =~ /-Set$/) { }
0 0 elsif (ref $$self{$key}) { }
2214 0 0 defined $$params{'checkSequenceNumber'} ? :
2218 0 0 if ($checkSequenceNumber ne $$self{'SequenceNumber'})
2250 0 0 if $encode_lang eq 'ja_JP.EUC'
2262 0 0 unless $mb = $string =~ s/^([\200-\377].)+// or $string =~ s/[\0-\177]+//
2265 0 0 if $mb
2269 0 0 if length $r