helly           Tue Mar 30 14:33:22 2004 EDT

  Modified files:              
    /php-src/scripts/dev        search_underscores.php 
  Log:
  Add more statistics
  
http://cvs.php.net/diff.php/php-src/scripts/dev/search_underscores.php?r1=1.1&r2=1.2&ty=u
Index: php-src/scripts/dev/search_underscores.php
diff -u php-src/scripts/dev/search_underscores.php:1.1 
php-src/scripts/dev/search_underscores.php:1.2
--- php-src/scripts/dev/search_underscores.php:1.1      Tue Mar 30 13:50:39 2004
+++ php-src/scripts/dev/search_underscores.php  Tue Mar 30 14:33:22 2004
@@ -23,7 +23,10 @@
    underscores. It omits magic names (e.g. anything that starts with two
    underscores but no more).
  */
-$cnt = 0;
+
+$cnt_modules = 0;
+$cnt_classes = 0;
+$cnt_methods = 0;
 $err = 0;
 
 $classes = array_merge(get_declared_classes(), get_declared_interfaces());
@@ -31,14 +34,14 @@
 $extensions = array();
 
 foreach(get_loaded_extensions() as $ext) {
-       $cnt++;
+       $cnt_modules++;
        if (strpos($ext, "_") !== false) {
                $err++;
                $extensions[$ext] = array();
        }
 }
 
-$cnt += count($classes);
+$cnt_classes = count($classes);
 
 foreach($classes as $c) {
        if (strpos($c, "_") !== false) {
@@ -52,7 +55,7 @@
                }
                $extensions[$ext][$c] = array();
                foreach(get_class_methods($c) as $method) {
-                       $cnt++;
+                       $cnt_methods++;
                        if (strpos(substr($method, substr($method, 0, 2) != "__"  ? 0 
: 2), "_") !== false) {
                                $err++;
                                $extensions[$ext][$c][] = $method;
@@ -61,10 +64,21 @@
        }
        else
        {
-               $cnt += count(get_class_methods($c));
+               $cnt_methods += count(get_class_methods($c));
        }
 }
 
+$cnt = $cnt_modules + $cnt_classes + $cnt_methods;
+
+printf("\n");
+printf("Modules: %5d\n", $cnt_modules);
+printf("Classes: %5d\n", $cnt_classes);
+printf("Methods: %5d\n", $cnt_methods);
+printf("\n");
+printf("Names:   %5d\n", $cnt);
+printf("Errors:  %5d (%.1f%%)\n", $err, round($err * 100 / $cnt, 1));
+printf("\n");
+
 ksort($extensions);
 foreach($extensions as $ext => &$classes) {
        echo "Extension: $ext\n";
@@ -79,8 +93,5 @@
 }
 
 printf("\n");
-printf("Names:  %5d\n", $cnt);
-printf("Errors: %5d (%.1f%%)\n", $err, round($err * 100 / $cnt, 1));
-printf("\n");
 
 ?>
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to