DNS/Zones.pm

filter: Statementstmt 37.2% 22 / 59 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 58.3% 7 / 12 Podpod 0.0% 0 / 5 totaltotal 32.2% 29 / 90 CC 6 SCAR 15.6
CC
6
Cov
32%
fetch
12.0
check
6.0
create
6.0
CRAP 4.8
« DNS/Owner.pm ↑ Summary DNS/Common.pm »
1 package Net::Duowan::DNS::Zones;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use base 'Net::Duowan::DNS::Common';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use vars qw/$VERSION/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 $VERSION = '1.2.0';
12  
13 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my $class = shift;
15 0 my $psp = shift;
16 0 my $token = shift;
17 0 bless { psp => $psp, token => $token },$class;
18 }
19  
20 0 ▶sub fetch {
Subroutine fetch: not called CC=3 SCAR=24.8
Pod undocumented
21 0 my $self = shift;
22  
23 0 my $psp = $self->{psp};
24 0 my $token = $self->{token};
25  
26 0 my %args = @_;
27 0 ▶ my $offset = $args{offset} || 0;
Condition0%0/2
$args{'offset'} || 0
l!l
00
MC/DC0%0/1
$args{'offset'} || 0
$args{'offset'}
Truth table0%0/2
A
A= $args{'offset'}
Aresult
11
00
28 0 ▶ my $number = $args{number} || -1;
Condition0%0/2
$args{'number'} || -1
l!l
00
MC/DC0%0/1
$args{'number'} || -1
$args{'number'}
Truth table0%0/2
A
A= $args{'number'}
Aresult
11
00
29  
30 0 my $act = 'zone_load_multi';
31 0 my %reqs = (a=>$act, psp=>$psp, tkn=>$token, offset=>$offset, number=>$number);
32  
33 0 return $self->reqTemplate(%reqs);
34 }
35  
36 0 ▶sub check {
Subroutine check: not called CC=2 SCAR=17.9
Pod undocumented
37 0 my $self = shift;
38  
39 0 my @zones = @_;
40 0 ▶ unless (@zones) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@zones) 0 0 0
41 0 croak "no zones list provided";
42 }
43  
44 0 my $zones = join ',',@zones;
45 0 my $psp = $self->{psp};
46 0 my $token = $self->{token};
47 0 my $act = 'zone_check';
48 0 my %reqs = (a=>$act, psp=>$psp, tkn=>$token, zones=>$zones);
49  
50 0 return $self->reqTemplate(%reqs);
51 }
52  
53 0 ▶sub create {
Subroutine create: not called CC=2 SCAR=17.9
Pod undocumented
54 0 my $self = shift;
55 0 ▶ my $zone = shift || croak "no zone provided";
Condition0%0/2
shift() || croak('no zone provided')
l!l
00
MC/DC0%0/1
shift() || croak('no zone provided')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
56  
57 0 my $psp = $self->{psp};
58 0 my $token = $self->{token};
59 0 my $act = 'zone_new';
60 0 my %reqs = (a=>$act, psp=>$psp, tkn=>$token, z=>$zone);
61  
62 0 return $self->reqTemplate(%reqs);
63 }
64  
65 0 ▶sub remove {
Subroutine remove: not called CC=2 SCAR=17.9
Pod undocumented
66 0 my $self = shift;
67 0 ▶ my $zone = shift || croak "no zone provided";
Condition0%0/2
shift() || croak('no zone provided')
l!l
00
MC/DC0%0/1
shift() || croak('no zone provided')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
68  
69 0 my $psp = $self->{psp};
70 0 my $token = $self->{token};
71 0 my $act = 'zone_delete';
72 0 my %reqs = (a=>$act, psp=>$psp, tkn=>$token, z=>$zone);
73  
74 0 return $self->reqTemplate(%reqs);
75 }
76  
77 2 1;
« DNS/Owner.pm ↑ Summary DNS/Common.pm »