my $error = 0;
my %where;
my %perm;
+my $allscore = 0;
+my $alllines = 0;
# each line starts with the complexity score
# 142 417 809 1677 1305 src/tool_getparam.c(1677): getparameter
for my $l (@output) {
chomp $l;
- if($l =~/^(\d+)\t\d+\t\d+\t\d+\t\d+\t([^\(]+).*: ([^ ]*)/) {
- my ($score, $path, $func)=($1, $2, $3);
+ if($l =~/^(\d+)\t\d+\t\d+\t\d+\t(\d+)\t([^\(]+).*: ([^ ]*)/) {
+ my ($score, $len, $path, $func)=($1, $2, $3, $4);
if($score > $show) {
my $allow = 0;
$error++;
}
}
+ $alllines += $len;
+ $allscore += ($len * $score);
}
}
$perm{$e} ? " [ALLOWED]": "";
}
+printf "\nAverage complexity: %.2f\n", $allscore / $alllines;
+
exit $error;