OptArgs2/Cmd_CI.pm

filter: Statementstmt 92.8% 52 / 56 Branchbran 55.5% 10 / 18 Conditioncond 41.6% 5 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 91.6% 11 / 12 Podpod 0.0% 0 / 3 totaltotal 71.5% 78 / 109 CC 15 SCAR 15.9
CC
15
Cov
78%
new
10.1
import
3.1
name
3.1
CRAP 4.9
« OptArgs2/StatusLine.pm ↑ Summary OptArgs2/Arg_CI.pm »
1 # Generated by Class::Inline version 0.0.1
2 # Date: Mon Oct 3 17:29:06 2022
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 4 ▶package OptArgs2::Cmd;BEGIN {require OptArgs2::CmdBase;our@ISA=('OptArgs2::CmdBase')};our$_HAS;sub OptArgs2::Cmd_CI::import {shift;$_HAS={@_ > 1 ? @_ : %{$_[0]}};$_HAS=$_HAS->{'has'}if exists$_HAS->{'has'}}our%_ATTRS;my%_BUILD_CHECK;sub new {my$class=shift;my$self={@_ ? @_ > 1 ? @_ : %{$_[0]}: ()};%_ATTRS=map {($_=>1)}keys %$self;bless$self,ref$class || $class;$_BUILD_CHECK{$class}//= do {my@possible=($class);my@BUILD;my@CHECK;while (@possible){no strict 'refs';my$c=shift@possible;push@BUILD,$c .'::BUILD' if exists &{$c .'::BUILD'};push@CHECK,$c .'::__CHECK' if exists &{$c .'::__CHECK'};push@possible,@{$c .'::ISA'}}[reverse(@CHECK),reverse(@BUILD)]};map {$self->$_}@{$_BUILD_CHECK{$class}};Carp::carp("OptArgs2::Cmd attribute '$_' unexpected")for keys%_ATTRS;$self}sub __RO {my (undef,undef,undef,$sub)=caller(1);Carp::croak("attribute $sub is read-only")}sub __CHECK {no strict 'refs';my$_attrs=*{ref($_[0]).'::_ATTRS'};map {delete$_attrs->{$_}}keys %$_HAS}sub name {$_[0]->__RO($_[1])if @_ > 1;$_[0]{'name'}//= $_HAS->{'name'}->{'default'}->($_[0])}sub no_help {$_[0]->__RO($_[1])if @_ > 1;$_[0]{'no_help'}//= $_HAS->{'no_help'}->{'default'}}BEGIN {$INC{'OptArgs2/Cmd.pm'}=__FILE__}
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine __CHECK: called CC=1 SCAR=0.1
Subroutine __RO: not called CC=1 SCAR=0.1
Subroutine import: called CC=3 SCAR=11.4
Subroutine name: called CC=3 SCAR=11.4
Subroutine new: called CC=9 SCAR=23.2
Subroutine no_help: called CC=3 SCAR=11.4
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 9 branches
BranchTrueFalseTotal
@_ > 1 ? : 4 0 4
if exists $OptArgs2::Cmd::_HAS->{"has"} 4 0 4
if @_ > 1 0 4 4
@_ ? : 7 0 7
@_ > 1 ? : 7 0 7
if (@possible) 8 4 12
if exists &{$c . '::BUILD';} 8 0 8
if exists &{$c . '::__CHECK';} 8 0 8
if @_ > 1 0 6 6
Condition41%5/12
$_[0]{"name"} //= $OptArgs2::Cmd::_HAS->{"name"}{"default"}->($_[0])
l!l&&r!l&&!r
040
ref $class || $class
l!l&&r!l&&!r
070
$_BUILD_CHECK{$class} //= do { my(@possible) = $class; my(@BUILD, @CHECK); while (@possible) { no strict 'refs'; my $c = shift @possible; push @BUILD, $c . '::BUILD' if exists &{$c . '::BUILD';}; push @CHECK, $c . '::__CHECK' if exists &{$c . '::__CHECK';}; push @possible, @{$c . '::ISA';}; } ; [reverse(@CHECK), reverse(@BUILD)] }
l!l&&r!l&&!r
340
$_[0]{"no_help"} //= $OptArgs2::Cmd::_HAS->{"no_help"}{"default"}
l!l&&r!l&&!r
006
MC/DC0%0/2
$_[0]{"name"} //= $OptArgs2::Cmd::_HAS->{"name"}{"default"}->($_[0])
$_[0]{"name"} $OptArgs2::Cmd::_HAS->{"name"}{"default"}->($_[0])
MC/DC0%0/2
ref $class || $class
ref $class $class
MC/DC0%0/2
$_BUILD_CHECK{$class} //= do { my(@possible) = $class; my(@BUILD, @CHECK); while (@possible) { no strict 'refs'; my $c = shift @possible; push @BUILD, $c . '::BUILD' if exists &{$c . '::BUILD';}; push @CHECK, $c . '::__CHECK' if exists &{$c . '::__CHECK';}; push @possible, @{$c . '::ISA';}; } ; [reverse(@CHECK), reverse(@BUILD)] }
$_BUILD_CHECK{$class} do { my(@possible) = $class; my(@BUILD, @CHECK); while (@possible) { no strict 'refs'; my $c = shift @possible; push @BUILD, $c . '::BUILD' if exists &{$c . '::BUILD';}; push @CHECK, $c . '::__CHECK' if exists &{$c . '::__CHECK';}; push @possible, @{$c . '::ISA';}; } ; [reverse(@CHECK), reverse(@BUILD)] }
MC/DC0%0/2
$_[0]{"no_help"} //= $OptArgs2::Cmd::_HAS->{"no_help"}{"default"}
$_[0]{"no_help"} $OptArgs2::Cmd::_HAS->{"no_help"}{"default"}
Truth table33%1/3
A //= B
A= $_[0]{"name"}B= $OptArgs2::Cmd::_HAS->{"name"}{"default"}->($_[0])
ABresult
1X1
011
000
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
Truth table66%2/3
A //= B
A= $_BUILD_CHECK{$class}B= do { my(@possible) = $class; my(@BUILD, @CHECK); while (@possible) { no strict 'refs'; my $c = shift @possible; push @BUILD, $c . '::BUILD' if exists &{$c . '::BUILD';}; push @CHECK, $c . '::__CHECK' if exists &{$c . '::__CHECK';}; push @possible, @{$c . '::ISA';}; } ; [reverse(@CHECK), reverse(@BUILD)] }
ABresult
1X1
011
000
Truth table33%1/3
A //= B
A= $_[0]{"no_help"}B= $OptArgs2::Cmd::_HAS->{"no_help"}{"default"}
ABresult
1X1
011
000
8 4 1;
« OptArgs2/StatusLine.pm ↑ Summary OptArgs2/Arg_CI.pm »