lib/Net/SinFP3/Mode.pm

filter: Statementstmt 37.1% 13 / 35 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 100% 6 / 6 totaltotal 39.2% 22 / 56 CC 5 SCAR 20.7
CC
5
Cov
32%
init
20.0
new
6.0
take
2.0
CRAP 7.9
« lib/Net/SinFP3/Log/Console.pm ↑ Summary lib/Net/SinFP3/Output/CSV.pm »
1 #
2 # $Id: Mode.pm,v 008243d3e89a 2018/07/21 14:54:07 gomor $
3 #
4 package Net::SinFP3::Mode;
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
BranchTrueFalseTotal
unless (defined $self->global) 0 0 0
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 Next objects
38 0 ▶ if (@$take == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$take == 0) 0 0 0
39 0 return $self;
40 }
41  
42 0 my $next = ref($self->global->next);
43 0 for (@$take) {
44 0 ▶ if (/^$next$/) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^$next$/) 0 0 0
45 0 return $self;
46 }
47 }
48  
49 0 $log->error("Next type [$next] 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 0 ▶sub postSearch {
Subroutine postSearch: not called CC=1 SCAR=6.9
Pod documented
64 0 my $self = shift;
65 0 return $self;
66 }
67  
68 1 1;
69  
70 __END__
« lib/Net/SinFP3/Log/Console.pm ↑ Summary lib/Net/SinFP3/Output/CSV.pm »