CriticDB/Report.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond 60.0% 3 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 85.7% 36 / 42 CC 4 SCAR 7.0
CC
4
Cov
94%
new
3.1
text
2.0
BEGIN
1.0
CRAP 2.0
« CriticDB/DB/Index/Id.pm ↑ Summary CriticDB/DB/Index.pm »
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
l!l&&r!l&&!r
040
MC/DC0%0/2
ref $ref || $ref
ref $ref $ref
Truth table33%1/3
A || B
A= ref $refB= $ref
ABresult
1X1
011
000
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"
l!l
13
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"}
Aresult
11
00
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
BranchTrueFalseTotal
if ($violation) { } 1 4 5
26 4 else { @violations=@{$$self{violations}} }
27 5 return join('',map {$_->to_string()} @violations);
28 }
29  
30 2 1;
31  
32 __END__
« CriticDB/DB/Index/Id.pm ↑ Summary CriticDB/DB/Index.pm »