-# source examples need to be sucked into other places, other codebases. they are not
-# supposed to pile up here.
-source_example_depth=$(calculate_depth ~/cloud/example_source)
+# scans through items in the notes folder that begin with a pattern.
+# each of those is treated as an aggregable portion of the report.
+# first parameter is the title in the report, second and so on are
+# a list of directory patterns to scan and aggregate.
+function analyze_by_dir_patterns()
+{
+ local title="$1"; shift
+ local hier_depth=0
+ local hier_weight=0
+ for i in $@; do
+ temp_depth=$(calculate_depth $i)
+ hier_depth=$(($hier_depth + $temp_depth))
+ temp_weight=$(calculate_weight $i)
+ hier_weight=$(($hier_weight + $temp_weight))
+ done
+ total_overload=$(($hier_depth + $total_overload))
+ total_weight=$(($total_weight + $hier_weight))
+ full_report+=$(format_report_line "$hier_depth" "$hier_weight" "$title")
+}