| 1 | # | ||||||||||
| 2 | # $Id: Search.pm,v 008243d3e89a 2018/07/21 14:54:07 gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::SinFP3::Search; | ||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use base qw(Class::Gomor::Array); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | our @AS = qw( | |||||||||
| 10 | global | ||||||||||
| 11 | ); | ||||||||||
| 12 | 1 | __PACKAGE__->cgBuildIndices; | |||||||||
| 13 | 1 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 16 | 0 | my $self = shift->SUPER::new( | |||||||||
| 17 | @_, | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | if (!defined($self->global)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | die("[-] ".__PACKAGE__.": You must provide a global object\n"); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | return $self; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub take { | ||||||||
|
Subroutine
take: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | 0 | return []; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub init { | ||||||||
|
Subroutine
init: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 32 | 0 | my $self = shift; | |||||||||
| 33 | |||||||||||
| 34 | 0 | my $log = $self->global->log; | |||||||||
| 35 | |||||||||||
| 36 | 0 | my $take = $self->take; | |||||||||
| 37 | # By default we take all Mode objects | ||||||||||
| 38 | 0 | ▶ | if (@$take == 0) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | return $self; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | my $mode = ref($self->global->mode); | |||||||||
| 43 | 0 | for (@$take) { | |||||||||
| 44 | 0 | ▶ | if (/^$mode$/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | return $self; | |||||||||
| 46 | } | ||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 0 | $log->error("Mode type [$mode] not allowed with this plugin"); | |||||||||
| 50 | 0 | return; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 0 | ▶ | sub run { | ||||||||
|
Subroutine
run: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 54 | 0 | my $self = shift; | |||||||||
| 55 | 0 | return $self; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | sub post { | ||||||||
|
Subroutine
post: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 59 | 0 | my $self = shift; | |||||||||
| 60 | 0 | return $self; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 1 | 1; | |||||||||
| 64 | |||||||||||
| 65 | __END__ | ||||||||||