HTTPServer/NotFoundHandler.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 91.8% 34 / 37 CC 3 SCAR 4.1
CC
3
Cov
93%
handle
2.0
new
2.0
BEGIN
1.0
CRAP 1.5
« HTTPServer/BasicAuthenHandler.pm ↑ Summary HTTPServer/Handler.pm »
1 package POE::Component::Server::HTTPServer::NotFoundHandler;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use HTTP::Status;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use POE::Component::Server::HTTPServer::Handler qw( H_CONT H_FINAL );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use base 'POE::Component::Server::HTTPServer::Handler';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $Instance;
8  
9 3 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
10 3 my $class = shift;
11 3 ▶ $Instance = bless {}, $class
Branch: 1 branch
BranchTrueFalseTotal
unless defined $POE::Component::Server::HTTPServer::NotFoundHandler::Instance 2 1 3
12 unless defined($Instance);
13 3 return $Instance;
14 }
15  
16 6 ▶sub handle {
Subroutine handle: called CC=2 SCAR=7.1
Pod documented
17 6 my $self = shift;
18 6 my $context = shift;
19 6 $context->{response}->code( RC_NOT_FOUND );
20 6 my $message = "";
21 6 ▶ if ( defined($context->{error_message}) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $context->{"error_message"}) 0 6 6
22 0 $message = ":<BR>$context->{error_message}\n";
23 }
24 6 $context->{response}->content("<HTML><BODY>Not Found$message</BODY></HTML>");
25 6 return H_FINAL;
26 }
27  
28 2 1;
29 __END__
« HTTPServer/BasicAuthenHandler.pm ↑ Summary HTTPServer/Handler.pm »