Chloro/Trait/Class.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 91.6% 44 / 48 CC 6 SCAR 12.5
CC
6
Cov
97%
_unique_items
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« Chloro/Role/Form.pm ↑ Summary Chloro/Trait/Application/ToClass.pm »
1 package Chloro::Trait::Class;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 11 our $VERSION = '0.07';
8  
9 11 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 11 with 'Chloro::Role::Trait::HasFormComponents';
12  
13 30 ▶sub fields {
Subroutine fields: called CC=1 SCAR=0.0
Pod undocumented
14 30 my $self = shift;
15  
16 30 return $self->_unique_items('local_fields');
17 }
18  
19 27 ▶sub groups {
Subroutine groups: called CC=1 SCAR=0.0
Pod undocumented
20 27 my $self = shift;
21  
22 27 return $self->_unique_items('local_groups');
23 }
24  
25 57 ▶sub _unique_items {
Subroutine _unique_items: called CC=6 SCAR=17.9
26 57 my $self = shift;
27 57 my $meth = shift;
28  
29 57 my %seen;
30 my @items;
31  
32 57 for my $class ( $self->linearized_isa() ) {
33 176 my $meta = Class::MOP::class_of($class);
34  
35 176 ▶ next unless $meta && $meta->can($meth);
Branch: 1 branch
BranchTrueFalseTotal
unless $meta and $meta->can($meth) 115 61 176
Condition66%2/3
$meta and $meta->can($meth)
!ll&&!rl&&r
011561
MC/DC50%1/2
$meta and $meta->can($meth)
$meta $meta->can($meth)
Truth table66%2/3
A and B
A= $metaB= $meta->can($meth)
ABresult
0X0
100
111
36  
37 61 for my $item ( $meta->$meth() ) {
38 81 ▶ next if $seen{ $item->name() };
Branch: 1 branch
BranchTrueFalseTotal
if $seen{$item->name} 1 80 81
39  
40 80 push @items, $item;
41  
42 80 $seen{ $item->name() } = 1;
43 }
44 }
45  
46 57 return @items;
47 }
48  
49 11 1;
« Chloro/Role/Form.pm ↑ Summary Chloro/Trait/Application/ToClass.pm »