← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:11 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/ValuesAndExpressions/RequireNumberSeparators.pm
StatementsExecuted 19 statements in 356µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11122µs22µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@10Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@10
11114µs16µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::supported_parametersPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::supported_parameters
1119µs41µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@13Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@13
1119µs16µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@12Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@12
1119µs24µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@11Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@11
1119µs70µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@16Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@16
1118µs186µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::BEGIN@15Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@15
1116µs7µsPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::default_severityPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::default_severity
0000s0sPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::applies_toPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::applies_to
0000s0sPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::default_themesPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::default_themes
0000s0sPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::::violatesPerl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::violates
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8package Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators;
9
10248µs122µs
# spent 22µs within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@10 which was called: # once (22µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11223µs240µs
# spent 24µs (9+16) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@11 which was called: # once (9µs+16µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 24µs making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@11 # spent 16µs making 1 call to strict::import
12221µs223µs
# spent 16µs (9+7) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@12 which was called: # once (9µs+7µs) by Module::Pluggable::Object::_require at line 12
use warnings;
# spent 16µs making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@12 # spent 7µs making 1 call to warnings::import
13226µs273µs
# spent 41µs (9+32) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@13 which was called: # once (9µs+32µs) by Module::Pluggable::Object::_require at line 13
use Readonly;
# spent 41µs making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@13 # spent 32µs making 1 call to Exporter::import
14
15226µs2364µs
# spent 186µs (8+178) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@15 which was called: # once (8µs+178µs) by Module::Pluggable::Object::_require at line 15
use Perl::Critic::Utils qw{ :severities };
# spent 186µs making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@15 # spent 178µs making 1 call to Exporter::import
162190µs2132µs
# spent 70µs (9+62) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@16 which was called: # once (9µs+62µs) by Module::Pluggable::Object::_require at line 16
use base 'Perl::Critic::Policy';
# spent 70µs making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::BEGIN@16 # spent 62µs making 1 call to base::import
17
181600nsour $VERSION = '1.121';
19
20#-----------------------------------------------------------------------------
21
2212µs138µsReadonly::Scalar my $DESC => q{Long number not separated with underscores};
# spent 38µs making 1 call to Readonly::Scalar
2312µs151µsReadonly::Scalar my $EXPL => [ 59 ];
# spent 51µs making 1 call to Readonly::Scalar
24
25#-----------------------------------------------------------------------------
26
2711µs121µsReadonly::Scalar my $MINIMUM_INTEGER_WITH_MULTIPLE_DIGITS => 10;
# spent 21µs making 1 call to Readonly::Scalar
28
29
# spent 16µs (14+2) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::supported_parameters which was called: # once (14µs+2µs) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters {
30 return (
31 {
32111µs22µs name => 'min_value',
# spent 2µs making 2 calls to Readonly::Scalar::FETCH, avg 1µs/call
33 description => 'The minimum absolute value to require separators in.',
34 default_string => '10_000',
35 behavior => 'integer',
36 integer_minimum => $MINIMUM_INTEGER_WITH_MULTIPLE_DIGITS,
37 },
38 );
39}
40
4112µs
# spent 7µs (6+1) within Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::default_severity which was called: # once (6µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_LOW }
42sub default_themes { return qw( core pbp cosmetic ) }
43sub applies_to { return 'PPI::Token::Number' }
44
45#-----------------------------------------------------------------------------
46
47sub violates {
48 my ( $self, $elem, undef ) = @_;
49 my $min = $self->{_min_value};
50
51 return if $elem !~ m{ \d{4} }xms;
52 return if abs $elem->literal() < $min;
53
54 return $self->violation( $DESC, $EXPL, $elem );
55}
56
5714µs1;
58
59__END__