Index: src/CodeTools/DeclStats.cc
===================================================================
--- src/CodeTools/DeclStats.cc	(revision 0c82fec48a07c0a2b6d255c6384141d7fec74492)
+++ src/CodeTools/DeclStats.cc	(revision 567903e2d5b2b6c7d7cf34ad8b999f73fdfa5cbc)
@@ -17,4 +17,5 @@
 
 #include <iostream>
+#include <map>
 #include <string>
 #include <unordered_map>
@@ -44,6 +45,10 @@
 			/// Count of declarations with each number of polymorphic return types
 			VectorMap<unsigned> n_poly_returns;
-
-			Stats() : n_decls(0), mono_decls(0), poly_decls(0), by_name(), by_params(), by_returns(), n_poly_params(), n_poly_returns() {}
+			/// Count of declarations with each percentage of polymorphic parameters
+			std::map<unsigned, unsigned> p_poly_params;
+			/// Count of declarations with each percentage of polymorphic returns
+			std::map<unsigned, unsigned> p_poly_returns;
+
+			Stats() : n_decls(0), mono_decls(0), poly_decls(0), by_name(), by_params(), by_returns(), n_poly_params(), n_poly_returns(), p_poly_params(), p_poly_returns() {}
 
 			Stats& operator+= (const Stats& o) {
@@ -76,4 +81,12 @@
 				}
 
+				for ( const auto& entry : o.p_poly_params ) {
+					p_poly_params[ entry.first ] += entry.second;
+				}
+
+				for ( const auto& entry : o.p_poly_returns ) {
+					p_poly_returns[ entry.first ] += entry.second;
+				}
+
 				return *this;
 			}
@@ -108,4 +121,5 @@
 			++stats.by_params.at( n_params );
 			++stats.n_poly_params.at( n_poly_params );
+			if ( n_params > 0 ) ++stats.p_poly_params[ n_poly_params*100/n_params ];
 
 			unsigned n_returns = 0;
@@ -117,4 +131,5 @@
 			++stats.by_returns.at( n_returns );
 			++stats.n_poly_returns.at( n_poly_returns );
+			if ( n_returns > 0 ) ++stats.p_poly_returns[ n_poly_returns*100/n_returns ];
 		}
 
@@ -183,6 +198,8 @@
 			printAllMap("n_poly_params", [](const Stats& stats) { return stats.n_poly_params; });
 			printAllMap("n_params", [](const Stats& stats) { return stats.by_params; });
+			printAllMap("%_poly_params", [](const Stats& stats) { return stats.p_poly_params; });
 			printAllMap("n_poly_returns", [](const Stats& stats) { return stats.n_poly_returns; });
 			printAllMap("n_returns", [](const Stats& stats) { return stats.by_returns; });
+			printAllMap("%_poly_returns", [](const Stats& stats) { return stats.p_poly_returns; });
 		}
 	};
