← 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/Subroutines/ProhibitBuiltinHomonyms.pm
StatementsExecuted 20 statements in 365µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs16µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@10Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@10
1118µs59µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@18Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@18
1118µs29µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@13Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@13
1117µs638µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@15Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@15
1117µs18µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@11Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@11
1117µs11µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::BEGIN@12Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@12
1116µs7µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::default_severityPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::default_severity
1112µs2µsPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::supported_parametersPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::supported_parameters
0000s0sPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::applies_toPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::applies_to
0000s0sPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::default_themesPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::default_themes
0000s0sPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::::violatesPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::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::Subroutines::ProhibitBuiltinHomonyms;
9
10241µs116µs
# spent 16µs within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@10 which was called: # once (16µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11220µs230µs
# spent 18µs (7+11) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@11 which was called: # once (7µs+11µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 18µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@11 # spent 11µs making 1 call to strict::import
12218µs214µs
# spent 11µs (7+4) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@12 which was called: # once (7µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
# spent 11µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@12 # spent 4µs making 1 call to warnings::import
13225µs250µs
# spent 29µs (8+21) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@13 which was called: # once (8µs+21µs) by Module::Pluggable::Object::_require at line 13
use Readonly;
# spent 29µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@13 # spent 21µs making 1 call to Exporter::import
14
151200ns
# spent 638µs (7+631) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@15 which was called: # once (7µs+631µs) by Module::Pluggable::Object::_require at line 16
use Perl::Critic::Utils qw{ :severities :data_conversion
16128µs21.27ms :classification :characters };
# spent 638µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@15 # spent 631µs making 1 call to Exporter::import
17
182211µs2110µs
# spent 59µs (8+51) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@18 which was called: # once (8µs+51µs) by Module::Pluggable::Object::_require at line 18
use base 'Perl::Critic::Policy';
# spent 59µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::BEGIN@18 # spent 51µs making 1 call to base::import
19
201500nsour $VERSION = '1.121';
21
22#-----------------------------------------------------------------------------
23
2412µs126µsReadonly::Array my @ALLOW => qw( import AUTOLOAD DESTROY );
# spent 26µs making 1 call to Readonly::Array
2516µs339µsReadonly::Hash my %ALLOW => hashify( @ALLOW );
# spent 23µs making 1 call to Readonly::Hash # spent 15µs making 1 call to Perl::Critic::Utils::hashify # spent 1µs making 1 call to Readonly::Array::FETCHSIZE
2611µs122µsReadonly::Scalar my $DESC => q{Subroutine name is a homonym for builtin %s %s};
# spent 22µs making 1 call to Readonly::Scalar
2712µs140µsReadonly::Scalar my $EXPL => [177];
# spent 40µs making 1 call to Readonly::Scalar
28
29#-----------------------------------------------------------------------------
30
3114µs
# spent 2µs within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::supported_parameters which was called: # once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters { return () }
3212µs
# spent 7µs (6+1) within Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::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_HIGH }
33sub default_themes { return qw( core bugs pbp certrule ) }
34sub applies_to { return 'PPI::Statement::Sub' }
35
36#-----------------------------------------------------------------------------
37
38sub violates {
39 my ( $self, $elem, undef ) = @_;
40 return if $elem->isa('PPI::Statement::Scheduled'); #e.g. BEGIN, INIT, END
41 return if exists $ALLOW{ $elem->name() };
42
43 my $homonym_type = $EMPTY;
44 if ( is_perl_builtin( $elem ) ) {
45 $homonym_type = 'function';
46 }
47 elsif ( is_perl_bareword( $elem ) ) {
48 $homonym_type = 'keyword';
49 }
50 else {
51 return; #ok!
52 }
53
54 my $desc = sprintf $DESC, $homonym_type, $elem->name();
55 return $self->violation($desc, $EXPL, $elem);
56}
57
5816µs1;
59
60__END__