DMOSS/Attr.pm

filter: Statementstmt 62.5% 20 / 32 Branchbran 36.3% 8 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 100% 6 / 6 totaltotal 55.8% 38 / 68 CC 12 SCAR 17.7
CC
12
Cov
52%
new
8.1
file
6.0
plugin
6.0
CRAP 5.8
« DMOSS/Plugin/VerifyLicense.pm ↑ Summary DMOSS/File.pm »
1 package DMOSS::Attr;
2 # ABSTRACT: DMOSS attribute object
3 3 $DMOSS::Attr::VERSION = '0.01_2';
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶sub new {
Subroutine new: called CC=7 SCAR=21.0
Pod documented
8 1 my ($class, $file, $plugin, $name, $value) = @_;
9 1 my $self = bless({}, $class);
10
11 1 ▶ $self->file($file) if $file;
Branch: 1 branch
BranchTrueFalseTotal
if $file 0 1 1
12 1 ▶ $self->plugin($plugin) if $plugin;
Branch: 1 branch
BranchTrueFalseTotal
if $plugin 0 1 1
13 1 ▶ $self->name($name) if $name;
Branch: 1 branch
BranchTrueFalseTotal
if $name 0 1 1
14 1 ▶ $self->value($value) if $value;
Branch: 1 branch
BranchTrueFalseTotal
if $value 0 1 1
15 1 ▶ $self->value({}) unless $self->value;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->value 1 0 1
16 1 ▶ $self->type(ref($value)) if $value;
Branch: 1 branch
BranchTrueFalseTotal
if $value 0 1 1
17  
18 1 return $self;
19 }
20  
21 0 ▶sub file {
Subroutine file: not called CC=2 SCAR=17.9
Pod documented
22 0 my ($self, $file) = @_;
23 0 ▶ $self->{file} = $file if $file;
Branch: 1 branch
BranchTrueFalseTotal
if $file 0 0 0
24  
25 0 return $self->{file};
26 }
27  
28 0 ▶sub plugin {
Subroutine plugin: not called CC=2 SCAR=17.9
Pod documented
29 0 my ($self, $plugin) = @_;
30 0 ▶ $self->{plugin} = $plugin if $plugin;
Branch: 1 branch
BranchTrueFalseTotal
if $plugin 0 0 0
31  
32 0 return $self->{plugin};
33 }
34  
35 0 ▶sub name {
Subroutine name: not called CC=2 SCAR=17.9
Pod documented
36 0 my ($self, $name) = @_;
37 0 ▶ $self->{name} = $name if $name;
Branch: 1 branch
BranchTrueFalseTotal
if $name 0 0 0
38  
39 0 return $self->{name};
40 }
41  
42 2 ▶sub value {
Subroutine value: called CC=2 SCAR=6.9
Pod documented
43 2 my ($self, $value) = @_;
44 2 ▶ $self->{value} = $value if $value;
Branch: 1 branch
BranchTrueFalseTotal
if $value 1 1 2
45  
46 2 return $self->{value};
47 }
48  
49 0 ▶sub type {
Subroutine type: not called CC=2 SCAR=17.9
Pod documented
50 0 my ($self, $type) = @_;
51 0 ▶ $self->{type} = $type if $type;
Branch: 1 branch
BranchTrueFalseTotal
if $type 0 0 0
52  
53 0 return $self->{type};
54 }
55  
56 3 1;
57  
58 __END__
« DMOSS/Plugin/VerifyLicense.pm ↑ Summary DMOSS/File.pm »