| 1 | package App::CriticDB::Report; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use Perl::Critic::Violation; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | our $VERSION='0.0.6'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||
| 10 | 4 | my ($ref,%opt)=@_; | |||||||||||||||||||
| 11 | 4 | ▶ | my $class=ref($ref)||$ref; | ||||||||||||||||||
|
Condition33%1/3
ref $ref || $ref
MC/DC0%0/2
ref $ref || $ref
ref $ref
$ref
Truth table33%1/3
A || B
A= ref $refB= $ref
| |||||||||||||||||||||
| 12 | my $self=bless({ | ||||||||||||||||||||
| 13 | format=>undef, | ||||||||||||||||||||
| 14 | %opt, | ||||||||||||||||||||
| 15 | violations=>$opt{violations}, | ||||||||||||||||||||
| 16 | 4 | },$class); | |||||||||||||||||||
| 17 | 4 | ▶ | $$self{verbose}//="%f: %m at line %l, column %c. (Severity: %s)\n"; | ||||||||||||||||||
|
Condition100%2/2
$self->{"verbose"} //= "%f: %m at line %l, column %c. (Severity: %s)\n"
MC/DC100%1/1
$self->{"verbose"} //= "%f: %m at line %l, column %c. (Severity: %s)\n"
$self->{"verbose"}
Truth table100%2/2
A
A= $self->{"verbose"}
| |||||||||||||||||||||
| 18 | 4 | Perl::Critic::Violation::set_format($$self{verbose}); | |||||||||||||||||||
| 19 | 4 | return $self; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 5 | ▶ | sub text { | ||||||||||||||||||
|
Subroutine
text: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 23 | 5 | my ($self,$violation)=@_; | |||||||||||||||||||
| 24 | 5 | my @violations; | |||||||||||||||||||
| 25 | 5 | ▶ | if($violation) { @violations=($violation) } | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 4 | else { @violations=@{$$self{violations}} } | |||||||||||||||||||
| 27 | 5 | return join('',map {$_->to_string()} @violations); | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 2 | 1; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||