| 1 | package Getopt::Yath::Settings::Group; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | our $VERSION = '2.000008'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Carp(); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | sub new { | ||||||||||||||||||||||||||||
| 10 | 62 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 62 | ▶ | my $self = (@_ != 1) ? { @_ } : $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 62 | return bless($self, $class); | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | sub all { return %{$_[0]} } | ||||||||||||||||||||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub check_option { exists($_[0]->{$_[1]}) ? 1 : 0 } | ||||||||||||||||||||||||||
|
Subroutine
check_option: not called CC=2 SCAR=17.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub option :lvalue { | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
option: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | my ($option, @vals) = @_; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | Carp::confess("Too many arguments for option()") if @vals > 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | Carp::confess("The '$option' option does not exist") unless exists $self->{$option}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | ($self->{$option}) = @vals if @vals; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | return $self->{$option}; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub create_option { | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
create_option: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 0 | my ($name, $val) = @_; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | $self->{$name} = $val; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | return $self->{$name}; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub option_ref { | ||||||||||||||||||||||||||||
| 42 | 1426 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
option_ref: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 1426 | my ($name, $create) = @_; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 1426 | ▶ | Carp::confess("The '$name' option does not exist") unless $create || exists $self->{$name}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$create or exists $self->{$name}
MC/DC0%0/2
$create or exists $self->{$name}
$create
exists $self->{$name}
Truth table33%1/3
A or B
A= $createB= exists $self->{$name}
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 1426 | return \($self->{$name}); | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | sub delete_option { | ||||||||||||||||||||||||||||
| 51 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
delete_option: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 52 | 0 | my ($name) = @_; | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 0 | delete $self->{$name}; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | sub remove_option { | ||||||||||||||||||||||||||||
| 58 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
remove_option: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 59 | 0 | my ($name) = @_; | |||||||||||||||||||||||||||
| 60 | 0 | delete ${$self}->{$name}; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 1 | our $AUTOLOAD; | |||||||||||||||||||||||||||
| 64 | sub AUTOLOAD : lvalue { | ||||||||||||||||||||||||||||
| 65 | 62 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=14.2
| |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 62 | my $option = $AUTOLOAD; | |||||||||||||||||||||||||||
| 68 | 62 | $option =~ s/^.*:://g; | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 62 | ▶ | return if $option eq 'DESTROY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 0 | ▶ | Carp::confess("Method $option() must be called on a blessed instance") unless ref($this); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 0 | $this->option($option, @_); | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | sub TO_JSON { | ||||||||||||||||||||||||||||
| 78 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
TO_JSON: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 79 | 0 | return {%$self}; | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 1 | 1; | |||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | __END__ | ||||||||||||||||||||||||||||