blib/lib/Perl/Type/Scalar.pm

filter: Statementstmt 97.2% 35 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 91.6% 11 / 12 Podpod n/a totaltotal 95.8% 46 / 48 CC 1 SCAR 0.8
CC
1
Cov
97%
Perl__Type__Scalar__MODE_ID
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Perl/Type/Void.pm ↑ Summary blib/lib/Perl/HelperFunctions_cpp.pm »
1 # [[[ HEADER ]]]
2 package Perl::Type::Scalar;
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Perl::Config; # don't use Perl::Types inside itself, in order to avoid circular includes
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 our $VERSION = 0.007_000;
7  
8 # [[[ OO INHERITANCE ]]]
9 5 ▶use parent qw(Perl::Type);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use Perl::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # [[[ CRITICS ]]]
13 ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
14 ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
15 ## no critic qw(Capitalization ProhibitMultiplePackages ProhibitReusedNames) # SYSTEM DEFAULT 3: allow multiple & lower case package names
16  
17 # [[[ CONSTANTS ]]]
18 # DEV NOTE: the special string 'inf' is recognized by Perl as representing infinity,
19 # but that is about the limit of the Perl interpreter's abilities and it does not appear to be officially documented?
20 # NEED ANSWER: why does `use constant INFINITY` cause the following error?
21 # Prototype mismatch: sub Perl::Type::Scalar::INFINITY: none vs () at /usr/share/perl/5.30/constant.pm line 171.
22 # could it be due to wholesale EXPORT and EXPORT_OK in Perl::Config or Perl::Types or perltypes??
23 #use constant INFINITY => my string $TYPED_INFINITY = 'inf';
24 5 ▶use constant INFINITY_VALUE => my string $TYPED_INFINITY_VALUE = 'inf';
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 # [[[ SUB-TYPES ]]]
27 # a scalartype is a known, non-void data type, meaning a number or a string
28 # DEV NOTE: do NOT overload Perl's 'scalar' keyword!!!
29 package scalartype;
30 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 5 ▶use parent qw(Perl::Type::Scalar);
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 # DEV NOTE, CORRELATION #rp018: Perl::Type::*.pm files do not 'use RPerl;' and thus do not trigger the pseudo-source-filter contained in
35 # RPerl::CompileUnit::Module::Class::create_symtab_entries_and_accessors_mutators(),
36 # so *__MODE_ID() subroutines are hard-coded here instead of auto-generated there
37 package main;
38 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 0 ▶sub Perl__Type__Scalar__MODE_ID { return 0; }
Subroutine Perl__Type__Scalar__MODE_ID: not called CC=1 SCAR=6.9
41  
42 5 1; # end of class
« blib/lib/Perl/Type/Void.pm ↑ Summary blib/lib/Perl/HelperFunctions_cpp.pm »