Categorizer/ObjectSet.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 7 totaltotal 74.2% 26 / 35 CC 3 SCAR 4.1
CC
3
Cov
95%
new
2.0
insert
2.0
includes_name
2.0
CRAP 1.5
« Categorizer/Learner/NaiveBayes.pm ↑ Summary Categorizer/Learner/Rocchio.pm »
1 package AI::Categorizer::ObjectSet;
2 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 132 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
5 132 my $pkg = shift;
6 132 my $self = bless {}, $pkg;
7 132 ▶ $self->insert(@_) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 67 65 132
8 132 return $self;
9 }
10  
11 198 ▶sub members {
Subroutine members: called CC=1 SCAR=0.0
Pod undocumented
12 198 return values %{$_[0]};
13 }
14  
15 9 ▶sub size {
Subroutine size: called CC=1 SCAR=0.0
Pod undocumented
16 9 return scalar keys %{$_[0]};
17 }
18  
19 187 ▶sub insert {
Subroutine insert: called CC=2 SCAR=6.9
Pod undocumented
20 187 my $self = shift;
21 187 foreach my $element (@_) {
22 #warn "types are ", @_;
23 188 $self->{ $element->name } = $element;
24 }
25 }
26  
27 7 ▶sub retrieve { $_[0]->{$_[1]} }
Subroutine retrieve: called CC=1 SCAR=0.0
Pod undocumented
28  
29 16 ▶sub includes { exists $_[0]->{ $_[1]->name } }
Subroutine includes: called CC=1 SCAR=0.0
Pod undocumented
30 0 ▶sub includes_name { exists $_[0]->{ $_[1] } }
Subroutine includes_name: not called CC=1 SCAR=6.9
Pod undocumented
31  
32 11 1;
« Categorizer/Learner/NaiveBayes.pm ↑ Summary Categorizer/Learner/Rocchio.pm »