{ head("Lintian Tags") }
  <h1>Tags</h1>

  <p>
    This is a list of all tags that occur at least once in the archive
    sorted by severity and then by certainty.  This includes all tags,
    even experimental and info tags.
  </p>

{
    my @tags = sort keys %tags;
    for my $severity (qw/serious important normal minor wishlist pedantic/) {
        for my $certainty (qw/certain possible wild-guess/) {
            my $heading = 0;
            for my $tag (@tags) {
                my ($first) = @{ $tags{$tag} };
                next unless $first->{severity} eq $severity;
                next unless $first->{certainty} eq $certainty;
                unless ($heading) {
                    $OUT .= "  <h2>Severity: $severity,";
                    $OUT .= " Certainty: $certainty</h2>\n\n";
                    $OUT .= "  <ul>\n";
                    $heading = 1;
                }
                my $packages = $stats{$tag}{'packages'};
                my $count = $stats{$tag}{'count'};
                my $overrides = $stats{$tag}{'overrides'};
                $OUT .= qq(    <li><a href="tags/$tag.html">$tag</a>)
                    . " ($packages packages, $count tags"
                    . ($overrides > 0 ? ", plus $overrides overrides" : "")
                    . ")</li>\n";
            }
            if ($heading) {
                $OUT .= "  </ul>\n\n";
            }
        }
    }
}
{ foot() }
