← 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:12 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Miscellanea/ProhibitUselessNoCritic.pm
StatementsExecuted 20 statements in 618µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs483µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@18Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@18
11115µs15µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@10Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@10
11114µs104µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@19Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@19
1118µs28µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@14Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@14
1118µs9µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::default_severityPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::default_severity
1117µs139µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@16Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@16
1117µs10µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@12Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@12
1116µs17µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::BEGIN@11Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@11
1112µs2µsPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::supported_parametersPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::supported_parameters
0000s0sPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::__ANON__[:47]Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::__ANON__[:47]
0000s0sPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::_annotation_suppresses_violationPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::_annotation_suppresses_violation
0000s0sPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::applies_toPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::applies_to
0000s0sPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::default_themesPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::default_themes
0000s0sPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::::violatesPerl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::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::Miscellanea::ProhibitUselessNoCritic;
9
10242µs115µs
# spent 15µs within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@10 which was called: # once (15µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11220µs228µs
# spent 17µs (6+11) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@11 which was called: # once (6µs+11µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 17µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@11 # spent 11µs making 1 call to strict::import
12220µs214µs
# spent 10µs (7+4) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@12 which was called: # once (7µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
# spent 10µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14228µs248µs
# spent 28µs (8+20) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@14 which was called: # once (8µs+20µs) by Module::Pluggable::Object::_require at line 14
use Readonly;
# spent 28µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@14 # spent 20µs making 1 call to Exporter::import
15
16224µs2271µs
# spent 139µs (7+132) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@16 which was called: # once (7µs+132µs) by Module::Pluggable::Object::_require at line 16
use List::MoreUtils qw< none >;
# spent 139µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@16 # spent 132µs making 1 call to Exporter::Tiny::import
17
18288µs2950µs
# spent 483µs (16+467) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@18 which was called: # once (16µs+467µs) by Module::Pluggable::Object::_require at line 18
use Perl::Critic::Utils qw{ :severities :classification hashify };
# spent 483µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@18 # spent 467µs making 1 call to Exporter::import
192378µs2193µs
# spent 104µs (14+90) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@19 which was called: # once (14µs+90µs) by Module::Pluggable::Object::_require at line 19
use base 'Perl::Critic::Policy';
# spent 104µs making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::BEGIN@19 # spent 90µs making 1 call to base::import
20
2111µsour $VERSION = '1.121';
22
23#-----------------------------------------------------------------------------
24
2513µs150µsReadonly::Scalar my $DESC => q{Useless '## no critic' annotation};
# spent 50µs making 1 call to Readonly::Scalar
2612µs135µsReadonly::Scalar my $EXPL => q{This annotation can be removed};
# spent 35µs making 1 call to Readonly::Scalar
27
28#-----------------------------------------------------------------------------
29
3014µs
# spent 2µs within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::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 () }
3112µs
# spent 9µs (8+2) within Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::default_severity which was called: # once (8µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_LOW }
32sub default_themes { return qw(core maintenance) }
33sub applies_to { return 'PPI::Document' }
34
35#-----------------------------------------------------------------------------
36
37sub violates {
38 my ( $self, undef, $doc ) = @_;
39
40 # If for some reason $doc is not a P::C::Document, then all bets are off
41 return if not $doc->isa('Perl::Critic::Document');
42
43 my @violations = ();
44 my @suppressed_viols = $doc->suppressed_violations();
45
46 for my $ann ( $doc->annotations() ) {
47 if ( none { _annotation_suppresses_violation($ann, $_) } @suppressed_viols ) {
48 push @violations, $self->violation($DESC, $EXPL, $ann->element());
49 }
50 }
51
52 return @violations;
53}
54
55#-----------------------------------------------------------------------------
56
57sub _annotation_suppresses_violation {
58 my ($annotation, $violation) = @_;
59
60 my $policy_name = $violation->policy();
61 my $line = $violation->location()->[0];
62
63 return $annotation->disables_line($line)
64 && $annotation->disables_policy($policy_name);
65}
66
67#-----------------------------------------------------------------------------
68
6916µs1;
70
71__END__