On Dec 19, 2006, at 2:43 PM, Matisse Enzer wrote:
I agree that ( $a == $b ) is not an extra branch, but, it is
harder for a human to understand than
( $a )
When did this thread change from code complexity to human
understandability? Those are rather different topics.
( $a ) of course
On Dec 17, 2006, at 9:02 PM, Randy W. Sims wrote:
Matisse Enzer wrote:
On Dec 15, 2006, at 10:13 PM, Chris Dolan wrote:
OK, I see. Perhaps I was distracted from your main point by
mention of cyclomatic complexity, which has a rather specific
definition.
Mea culpa.
In the next release I
On 12/10/06, Matisse Enzer <[EMAIL PROTECTED]> wrote:
Now in a CPAN near you: Perl::Metrics::Simple 0.30
Ah, the old Simple versus Basic argument:
http://search.cpan.org/dist/Perl-Metric-Basic/
Leon, who has already renamed it once to please Adam.
Matisse Enzer wrote:
On Dec 15, 2006, at 10:13 PM, Chris Dolan wrote:
OK, I see. Perhaps I was distracted from your main point by mention
of cyclomatic complexity, which has a rather specific definition.
Mea culpa.
In the next release I will change the documentation for
Perl::Metrics::Si
On Dec 16, 2006, at 12:07 PM, Matisse Enzer wrote:
On Dec 15, 2006, at 10:13 PM, Chris Dolan wrote:
OK, I see. Perhaps I was distracted from your main point by
mention of cyclomatic complexity, which has a rather specific
definition.
Mea culpa.
In the next release I will change the docum
On Dec 15, 2006, at 10:13 PM, Chris Dolan wrote:
OK, I see. Perhaps I was distracted from your main point by
mention of cyclomatic complexity, which has a rather specific
definition.
Mea culpa.
In the next release I will change the documentation for
Perl::Metrics::Simple to make clear
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
}
On Dec 15, 2006, at 7:52 AM, 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
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
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 $
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;
}
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;
}
elsif ( $type eq 'ARRAY' ) {
foreach my $
Matisse Enzer wrote:
>sub complexity_of_six {
>my $bar = shift;
>my $total = 0;
>my $type = ref $bar;
>if ( ! $type ) {
>$total = $bar;
>}
>elsif ( $type eq 'ARRAY' ) {
>foreach my $baz ( @{$bar} ) {
>$total
On Dec 10, 2006, at 1:16 AM, Ovid wrote:
--- Matisse Enzer <[EMAIL PROTECTED]> wrote:
McCabe Complexity
-
Code not in any subroutine::
min: 1
max 10
mean: 1.00
std. deviation: 2.54
median: 1.00
Subroutines/
Now in a CPAN near you: Perl::Metrics::Simple 0.30
Installs thecountperlscript which you point at one or more
Perl files (and/or directories) and get a report of all the
subroutines, sorted by complexity.
Line counts exclude both comments and pod.
For example:
% countperl lib
15 matches
Mail list logo