mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:11:45 +03:00
parent
b6c636256d
commit
f5a44e1549
1 changed files with 8 additions and 2 deletions
|
|
@ -87,12 +87,14 @@ my $show = 65;
|
|||
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;
|
||||
|
|
@ -106,6 +108,8 @@ for my $l (@output) {
|
|||
$error++;
|
||||
}
|
||||
}
|
||||
$alllines += $len;
|
||||
$allscore += ($len * $score);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -121,4 +125,6 @@ for my $e (sort {$where{$b} <=> $where{$a}} keys %where) {
|
|||
$perm{$e} ? " [ALLOWED]": "";
|
||||
}
|
||||
|
||||
printf "\nAverage complexity: %.2f\n", $allscore / $alllines;
|
||||
|
||||
exit $error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue