| 1 | package Egg::View::Mail::Plugin::PortCheck; | ||||||||||||||||||||
| 2 | # | ||||||||||||||||||||
| 3 | # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> | ||||||||||||||||||||
| 4 | # | ||||||||||||||||||||
| 5 | # $Id: PortCheck.pm 285 2008-02-28 04:20:55Z lushe $ | ||||||||||||||||||||
| 6 | # | ||||||||||||||||||||
| 7 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 2 | ▶ | use Carp qw/ croak /; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 2 | our $VERSION = '0.01'; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 0 | ▶ | sub _setup { | ||||||||||||||||||
|
Subroutine
_setup: not called CC=5 SCAR=34.0
| |||||||||||||||||||||
| 14 | 0 | my($class, $e)= @_; | |||||||||||||||||||
| 15 | 0 | ▶ | $e->isa('Egg::Plugin::Net::Scan') | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 16 | || die q{I want setup 'Egg::Plugin::Net::Scan'.}; | ||||||||||||||||||||
| 17 | 0 | my $c= $class->config; | |||||||||||||||||||
| 18 | 0 | ▶ | $c->{scan_host} ||= 'localhost'; | ||||||||||||||||||
|
Condition0%0/2
$c->{"scan_host"} ||= "localhost"
MC/DC0%0/1
$c->{"scan_host"} ||= "localhost"
$c->{"scan_host"}
Truth table0%0/2
A
A= $c->{"scan_host"}
| |||||||||||||||||||||
| 19 | 0 | ▶ | $c->{scan_port} ||= 25; | ||||||||||||||||||
|
Condition0%0/2
$c->{"scan_port"} ||= 25
MC/DC0%0/1
$c->{"scan_port"} ||= 25
$c->{"scan_port"}
Truth table0%0/2
A
A= $c->{"scan_port"}
| |||||||||||||||||||||
| 20 | 0 | ▶ | $c->{scan_timeout} ||= 3; | ||||||||||||||||||
|
Condition0%0/2
$c->{"scan_timeout"} ||= 3
MC/DC0%0/1
$c->{"scan_timeout"} ||= 3
$c->{"scan_timeout"}
Truth table0%0/2
A
A= $c->{"scan_timeout"}
| |||||||||||||||||||||
| 21 | 0 | $class->mk_accessors('scan'); | |||||||||||||||||||
| 22 | 0 | $class->next::method($e); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | 0 | ▶ | sub send { | ||||||||||||||||||
|
Subroutine
send: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 25 | 0 | my $self= shift; | |||||||||||||||||||
| 26 | 0 | my $c = $self->config; | |||||||||||||||||||
| 27 | 0 | ▶ | my $res = $self->scan || do { | ||||||||||||||||||
|
Condition0%0/3
$self->scan || do {
my $scan = $self->e->port_scan(@{$c;}{'scan_host', 'scan_port'}, 'timeout', $c->{'scan_timeout'});
$self->scan($scan)
}
MC/DC0%0/2
$self->scan || do {
my $scan = $self->e->port_scan(@{$c;}{'scan_host', 'scan_port'}, 'timeout', $c->{'scan_timeout'});
$self->scan($scan)
}
$self->scan
do {
my $scan = $self->e->port_scan(@{$c;}{'scan_host', 'scan_port'}, 'timeout', $c->{'scan_timeout'});
$self->scan($scan)
}
Truth table0%0/3
A || B
A= $self->scanB= do {
my $scan = $self->e->port_scan(@{$c;}{'scan_host', 'scan_port'}, 'timeout', $c->{'scan_timeout'});
$self->scan($scan)
}
| |||||||||||||||||||||
| 28 | my $scan= $self->e->port_scan | ||||||||||||||||||||
| 29 | 0 | (@{$c}{qw/ scan_host scan_port /}, timeout=> $c->{scan_timeout} ); | |||||||||||||||||||
| 30 | 0 | $self->scan($scan); | |||||||||||||||||||
| 31 | }; | ||||||||||||||||||||
| 32 | 0 | ▶ | $res->is_success ? $self->next::method(@_): 0; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 2 | 1; | |||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||