Prolog/Term/Number.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 87.5% 35 / 40 CC 3 SCAR 5.1
CC
3
Cov
96%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Prolog/TermList/Clause.pm ↑ Summary Prolog/TermList/Primitive.pm »
1 package AI::Prolog::Term::Number;
2 13 $REVISION = '$Id: Number.pm,v 1.3 2005/02/28 02:32:11 ovid Exp $';
3 13 $VERSION = '0.1';
4 13 @ISA = 'AI::Prolog::Term';
5 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 13 ▶use Scalar::Util qw/looks_like_number/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 13 ▶use aliased 'AI::Prolog::Term';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 102 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
12 102 my ($proto, $number) = @_;
13 102 my $self = $proto->SUPER::new($number, 0);
14 102 ▶ $self->{varid} = defined $number && looks_like_number($number)
Branch: 1 branch
BranchTrueFalseTotal
defined $number && &looks_like_number($number) ? : 101 1 102
Condition66%2/3
defined $number and &looks_like_number($number)
!ll&&!rl&&r
10101
MC/DC50%1/2
defined $number and &looks_like_number($number)
defined $number &looks_like_number($number)
Truth table66%2/3
A and B
A= defined $numberB= &looks_like_number($number)
ABresult
0X0
100
111
15 ? $number
16 : 0;
17 102 return $self;
18 }
19  
20 92 ▶sub value { shift->{varid} }
Subroutine value: called CC=1 SCAR=0.0
Pod undocumented
21  
22 1 ▶sub dup { # should this be recast as the parent?
Subroutine dup: called CC=1 SCAR=0.0
Pod undocumented
23 1 my $self = shift;
24 1 return $self->new($self->{varid});
25 }
26  
27 13 1;
28  
29 __END__
« Prolog/TermList/Clause.pm ↑ Summary Prolog/TermList/Primitive.pm »