## name parm-based pass
## failures 0
## parms { max_mccabe => 100 }
## cut
sub test_sub {
if ( $foo && $bar || $baz ) {
open my $fh, '<', $file or die $!;
}
elsif ( $blah >>= some_function() ) {
return if $barf;
}
else {
$results = $condition ? 1 : 0;
}
croak unless $result;
while( $condition ){ frobulate() }
until( $foo > $baz ){ blech() }
}
#-----------------------------------------------------------------------------
## name parm-based failure
## failures 1
## parms { max_mccabe => 1 }
## cut
sub test_sub {
if ( $foo && $bar || $baz ) {
open my $fh, '<', $file or die $!;
}
elsif ( $blah >>= some_function() ) {
return if $barf;
}
else {
$results = $condition ? 1 : 0;
}
croak unless $result;
}
#-----------------------------------------------------------------------------
## name no-op sub
## failures 0
## cut
sub test_sub {
}
#-----------------------------------------------------------------------------
##############################################################################
# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/t/Subroutines/ProhibitExcessComplexity.run $
# $Date: 2009-02-15 09:10:42 -0800 (Sun, 15 Feb 2009) $
# $Author: clonezone $
# $Revision: 3116 $
##############################################################################
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 78
# indent-tabs-mode: nil
# c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :