Re: Perl::Metrics::Simple 0.30

2006-12-15 Thread Chris Dolan
On Dec 14, 2006, at 11:20 PM, Matisse Enzer wrote: On Dec 14, 2006, at 3:05 PM, Michael G Schwern wrote: Matisse Enzer wrote: sub complexity_of_six { my $bar = shift; my $total = 0; my $type = ref $bar; if ( ! $type ) { $total = $bar; }

Re: Perl::Metrics::Simple 0.30

2006-12-15 Thread Michael G Schwern
Chris Dolan wrote: That can't be right. Negation does not contribute to complexity. Instead, I believe it is the for loop and the exit points that are increasing your count. Consider rewriting the for as ifs and gotos: sub complexity_of_six { my $bar = shift; my $total

Re: Perl::Metrics::Simple 0.30

2006-12-15 Thread Matisse Enzer
On Dec 15, 2006, at 7:52 AM, Chris Dolan wrote: That can't be right. Negation does not contribute to complexity. I think it is fair to say, that to a human, negation *can* increase complexity: if ( $foo ) { # do something } is a little bit easier to understand than: if

Re: Perl::Metrics::Simple 0.30

2006-12-15 Thread Chris Dolan
On Dec 15, 2006, at 10:22 PM, Matisse Enzer wrote: On Dec 15, 2006, at 7:52 AM, Chris Dolan wrote: That can't be right. Negation does not contribute to complexity. I think it is fair to say, that to a human, negation *can* increase complexity: if ( $foo ) { # do something