1 ##############################################################################
2 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/Modules/ProhibitExcessMainComplexity.run $
3 # $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
6 ##############################################################################
8 #-----------------------------------------------------------------------------
10 ## name param-based failure
12 ## parms { max_mccabe => 100 }
15 if ( $foo && $bar || $baz ) {
16 open my $fh, '<', $file or die $!;
18 elsif ( $blah >>= some_function() ) {
22 $results = $condition ? 1 : 0;
26 while( $condition ){ frobulate() }
27 until( $foo > $baz ){ blech() }
29 #-----------------------------------------------------------------------------
31 ## name parm-based failure
33 ## parms { max_mccabe => 1 }
37 if ( $foo && $bar || $baz ) {
38 open my $fh, '<', $file or die $!;
40 elsif ( $blah >>= some_function() ) {
44 $results = $condition ? 1 : 0;
49 #-----------------------------------------------------------------------------
51 ## name exclude code inside subroutines
53 ## parms { max_mccabe => 2 }
57 if ( $foo && $bar || $baz ) {
58 open my $fh, '<', $file or die $!;
60 elsif ( $blah >>= some_function() ) {
64 $results = $condition ? 1 : 0;
74 if ( $foo && $bar || $baz ) {
75 open my $fh, '<', $file or die $!;
77 elsif ( $blah >>= some_function() ) {
81 $results = $condition ? 1 : 0;
87 #-----------------------------------------------------------------------------
93 ##############################################################################
96 # cperl-indent-level: 4
98 # indent-tabs-mode: nil
99 # c-indentation-style: bsd
101 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :