From b7972285f923f572c89a50db5d9c2c33e9f46c4a Mon Sep 17 00:00:00 2001 From: JohT <7671054+JohT@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:02:20 +0200 Subject: [PATCH] Add drill-down pie chart for grouped least significant "others" --- jupyter/ExternalDependenciesJava.ipynb | 341 ++++++++++++++++-- jupyter/ExternalDependenciesTypescript.ipynb | 352 +++++++++++++++++-- 2 files changed, 640 insertions(+), 53 deletions(-) diff --git a/jupyter/ExternalDependenciesJava.ipynb b/jupyter/ExternalDependenciesJava.ipynb index bcdcab8eb..b35645241 100644 --- a/jupyter/ExternalDependenciesJava.ipynb +++ b/jupyter/ExternalDependenciesJava.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# External Dependencies\n", + "# External Dependencies for Java\n", "
\n", "\n", "### References\n", @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 481, + "execution_count": 233, "id": "4191f259", "metadata": {}, "outputs": [], @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 482, + "execution_count": 234, "id": "1c5dab37", "metadata": {}, "outputs": [], @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 483, + "execution_count": 235, "id": "c1db254b", "metadata": {}, "outputs": [], @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 484, + "execution_count": 236, "id": "59310f6f", "metadata": {}, "outputs": [], @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 485, + "execution_count": 237, "id": "f02d9944", "metadata": {}, "outputs": [], @@ -111,7 +111,42 @@ }, { "cell_type": "code", - "execution_count": 486, + "execution_count": 238, + "id": "47cc11b0", + "metadata": {}, + "outputs": [], + "source": [ + "def filter_values_below_threshold(data_frame : pd.DataFrame, value_column : str, upper_limit: float = 100.0) -> pd.DataFrame: \n", + " \"\"\"\n", + " Adds a new percentage column for the value column and \n", + " groups all values below the given threshold to \"others\" in the name column.\n", + "\n", + " Parameters:\n", + " - data_frame (pd.DataFrame): Input pandas DataFrame\n", + " - value_column (str): Name of the column that contains the numeric value\n", + " - upper_limit (float): Defaults to 100%. Filters out all entries exceeding this limit. Intended to drill down \"others\" in a second chart/table.\n", + "\n", + " Returns:\n", + " int:Returning value\n", + "\n", + " \"\"\"\n", + " result_data_frame = data_frame.copy();\n", + "\n", + " percent_column_name = value_column + 'Percent';\n", + "\n", + " # Add column with the name given in \"percent_column_name\" with the percentage of the value column.\n", + " result_data_frame[percent_column_name] = result_data_frame[value_column] / result_data_frame[value_column].sum() * 100.0;\n", + "\n", + " # Limit entries to meet the an optional upper limit (in percentage)\n", + " result_data_frame = result_data_frame.query(\"`\" + percent_column_name + \"` <= \" + str(upper_limit))\n", + "\n", + " result_data_frame = result_data_frame.reset_index(drop=True)\n", + " return result_data_frame.sort_values(by=percent_column_name, ascending=False);" + ] + }, + { + "cell_type": "code", + "execution_count": 239, "id": "89a12ec4", "metadata": {}, "outputs": [], @@ -139,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 487, + "execution_count": 240, "id": "e9b1ccad", "metadata": {}, "outputs": [], @@ -177,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 488, + "execution_count": 241, "id": "da9e8edb", "metadata": {}, "outputs": [], @@ -211,7 +246,7 @@ }, { "cell_type": "code", - "execution_count": 490, + "execution_count": 243, "id": "c2496caf", "metadata": {}, "outputs": [], @@ -281,7 +316,7 @@ "id": "1143afcb", "metadata": {}, "source": [ - "#### Table 1 Chart 1 - Most called external packages in % by types\n", + "#### Table 1 Chart 1a - Most called external packages in % by types (more than 0.7% overall)\n", "\n", "External packages that are used less than 0.7% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -302,7 +337,38 @@ ")\n", "plot_pie_chart(\n", " input_data_frame=external_package_by_type_usage_significant,\n", - " title='Top external package usage [%] by type'\n", + " title='Top external package usage [%] by type (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "61565f22", + "metadata": {}, + "source": [ + "#### Table 1 Chart 1b - Most called external packages in % by types (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external package. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d15ba749", + "metadata": {}, + "outputs": [], + "source": [ + "external_package_by_type_usage_drill_down_others=filter_values_below_threshold(external_package_usage, 'numberOfExternalCallerTypes', 0.7)\n", + "\n", + "external_package_by_type_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_package_by_type_usage_drill_down_others,\n", + " value_column='numberOfExternalCallerTypes',\n", + " name_column='externalPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_package_by_type_usage_significant_drill_down_others,\n", + " title='Top external package usage [%] by type (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -311,7 +377,7 @@ "id": "84c123dc", "metadata": {}, "source": [ - "#### Table 1 Chart 2 - Most called external packages in % by packages\n", + "#### Table 1 Chart 2a - Most called external packages in % by packages (more than 0.7% overall)\n", "\n", "External packages that are used less than 0.7% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -332,7 +398,38 @@ ")\n", "plot_pie_chart(\n", " input_data_frame=external_package_by_package_usage_significant,\n", - " title='Top external package usage [%] by package'\n", + " title='Top external package usage [%] by package (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "db98344d", + "metadata": {}, + "source": [ + "#### Table 1 Chart 2b - Most called external packages in % by packages (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external package. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "62ffff85", + "metadata": {}, + "outputs": [], + "source": [ + "external_package_usage_by_package_drill_down_others=filter_values_below_threshold(external_package_usage, 'numberOfExternalCallerPackages', 0.7)\n", + "\n", + "external_package_by_package_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_package_usage_by_package_drill_down_others,\n", + " value_column='numberOfExternalCallerPackages',\n", + " name_column='externalPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_package_by_package_usage_significant_drill_down_others,\n", + " title='Top external package usage [%] by package (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -377,7 +474,7 @@ "id": "279932a6", "metadata": {}, "source": [ - "#### Table 2 Chart 1 - Most called second level external packages in % by type\n", + "#### Table 2 Chart 1a - Most called second level external packages in % by type\n", "\n", "External package groups that are used less than 0.7% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -398,7 +495,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_grouped_package_by_type_usage_significant,\n", - " title='Top external package (grouped by first 2 layers) usage [%] by type'\n", + " title='Top external package (grouped by first 2 layers) usage [%] by type (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "378b9eef", + "metadata": {}, + "source": [ + "#### Table 2 Chart 1b - Most called second level external packages in % by type (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external package. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4f8a467e", + "metadata": {}, + "outputs": [], + "source": [ + "external_grouped_package_by_type_usage_drill_down_others=filter_values_below_threshold(external_grouped_package_usage, 'numberOfExternalCallerTypes', 0.7)\n", + "\n", + "external_grouped_package_by_type_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_grouped_package_by_type_usage_drill_down_others,\n", + " value_column='numberOfExternalCallerTypes',\n", + " name_column='externalSecondLevelPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_grouped_package_by_type_usage_significant_drill_down_others,\n", + " title='Top external package (grouped by first 2 layers) usage [%] by type (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -407,7 +535,7 @@ "id": "43c3e1a3", "metadata": {}, "source": [ - "#### Table 2 Chart 2 - Most called second level external packages in % by package\n", + "#### Table 2 Chart 2a - Most called second level external packages in % by package (more than 0.7% overall)\n", "\n", "External package groups that are used less than 0.7% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -428,7 +556,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_grouped_package_by_package_usage_significant,\n", - " title='Top external package (grouped by first 2 layers) usage [%] by package'\n", + " title='Top external package (grouped by first 2 layers) usage [%] by package (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "aa3592f0", + "metadata": {}, + "source": [ + "#### Table 2 Chart 2b - Most called second level external packages in % by package (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external package. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09eae481", + "metadata": {}, + "outputs": [], + "source": [ + "external_grouped_package_by_package_usage_drill_down_others=filter_values_below_threshold(external_grouped_package_usage, 'numberOfExternalCallerPackages', 0.7)\n", + "\n", + "external_grouped_package_by_package_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_grouped_package_by_type_usage_drill_down_others,\n", + " value_column='numberOfExternalCallerPackages',\n", + " name_column='externalSecondLevelPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_grouped_package_by_package_usage_significant_drill_down_others,\n", + " title='Top external package (grouped by first 2 layers) usage [%] by package (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -561,7 +720,7 @@ "id": "b210eea0", "metadata": {}, "source": [ - "#### Table 3 Chart 1 - Most widely spread external packages in % by types\n", + "#### Table 3 Chart 1a - Most widely spread external packages in % by types (more than 0.5% overall)\n", "\n", "External packages that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external packages." ] @@ -581,7 +740,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_package_type_usage_spread_significant,\n", - " title='Top external package usage spread [%] by type'\n", + " title='Top external package usage spread [%] by type (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "d380fd56", + "metadata": {}, + "source": [ + "#### Table 3 Chart 1b - Most widely spread external packages in % by types (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most spread external packages. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b2eb0e8f", + "metadata": {}, + "outputs": [], + "source": [ + "external_package_type_usage_spread_drill_down_others=filter_values_below_threshold(external_package_usage_spread, 'sumNumberOfTypes', 0.5)\n", + "\n", + "external_package_type_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_package_type_usage_spread_drill_down_others,\n", + " value_column='sumNumberOfTypes',\n", + " name_column='externalPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_package_type_usage_spread_significant_drill_down_others,\n", + " title='Top external package usage spread [%] by type (less than 0.5% overall \"others\" drill-down)'\n", ")" ] }, @@ -590,7 +780,7 @@ "id": "c48740e3", "metadata": {}, "source": [ - "#### Table 3 Chart 2 - Most widely spread external packages in % by packages\n", + "#### Table 3 Chart 2a - Most widely spread external packages in % by packages (more than 0.5% overall)\n", "\n", "External packages that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external packages." ] @@ -610,7 +800,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_package_usage_package_spread_significant,\n", - " title='Top external package usage spread [%] by package'\n", + " title='Top external package usage spread [%] by package (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "f14995ee", + "metadata": {}, + "source": [ + "#### Table 3 Chart 2b - Most widely spread external packages in % by packages (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most spread external packages. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "08c09016", + "metadata": {}, + "outputs": [], + "source": [ + "external_package_usage_package_spread_drill_down_others=filter_values_below_threshold(external_package_usage_spread, 'sumNumberOfPackages', 0.5)\n", + "\n", + "external_grouped_package_type_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_package_usage_package_spread_drill_down_others,\n", + " value_column='sumNumberOfPackages',\n", + " name_column='externalPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_grouped_package_type_usage_spread_significant_drill_down_others,\n", + " title='Top external package usage spread [%] by type (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -657,7 +878,7 @@ "id": "e6f098e6", "metadata": {}, "source": [ - "#### Table 4 Chart 1 - Most widely spread second level external packages in % by type\n", + "#### Table 4 Chart 1a - Most widely spread second level external packages in % by type (more than 0.5% overall)\n", "\n", "External package groups that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -682,12 +903,43 @@ ")" ] }, + { + "cell_type": "markdown", + "id": "681b2597", + "metadata": {}, + "source": [ + "#### Table 4 Chart 1b - Most widely spread second level external packages in % by type (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "External packages that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external packages." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "062a297b", + "metadata": {}, + "outputs": [], + "source": [ + "external_grouped_package_type_usage_spread_drill_down_others=filter_values_below_threshold(external_grouped_package_usage_spread, 'sumNumberOfTypes', 0.5)\n", + "\n", + "external_package_usage_package_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_grouped_package_type_usage_spread_drill_down_others,\n", + " value_column='sumNumberOfTypes',\n", + " name_column='externalSecondLevelPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_package_usage_package_spread_significant_drill_down_others,\n", + " title='Top external package usage spread [%] by type (less than 0.7% overall \"others\" drill-down)'\n", + ")" + ] + }, { "cell_type": "markdown", "id": "0b91082e", "metadata": {}, "source": [ - "#### Table 4 Chart 2 - Most widely spread second level external packages in % by package\n", + "#### Table 4 Chart 2a - Most widely spread second level external packages in % by package (more than 0.5% overall)\n", "\n", "External package groups that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart\n", "with the most significant external packages and how ofter they are called in percent." @@ -708,7 +960,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_grouped_package_package_usage_spread_significant,\n", - " title='Top external package (grouped by first 2 layers) usage spread [%] by package'\n", + " title='Top external package (grouped by first 2 layers) usage spread [%] by package (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "c6234de8", + "metadata": {}, + "source": [ + "#### Table 4 Chart 2b - Most widely spread second level external packages in % by package (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "External packages that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external packages." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6a03be97", + "metadata": {}, + "outputs": [], + "source": [ + "external_grouped_package_package_usage_spread_drill_down_others=filter_values_below_threshold(external_grouped_package_usage_spread, 'sumNumberOfPackages', 0.5)\n", + "\n", + "external_grouped_package_package_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_grouped_package_package_usage_spread_drill_down_others,\n", + " value_column='sumNumberOfPackages',\n", + " name_column='externalSecondLevelPackageName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_grouped_package_package_usage_spread_significant_drill_down_others,\n", + " title='Top external package (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -857,7 +1140,7 @@ }, { "cell_type": "code", - "execution_count": 511, + "execution_count": 210, "id": "fd9667a9", "metadata": {}, "outputs": [], @@ -1297,7 +1580,7 @@ }, { "cell_type": "code", - "execution_count": 525, + "execution_count": 224, "id": "ad1db8af", "metadata": {}, "outputs": [], @@ -1434,7 +1717,7 @@ }, { "cell_type": "code", - "execution_count": 529, + "execution_count": 228, "id": "46baa3c1", "metadata": {}, "outputs": [], @@ -1468,7 +1751,7 @@ "pygments_lexer": "ipython3", "version": "3.11.9" }, - "title": "Object Oriented Design Quality Metrics for Java with Neo4j" + "title": "External Dependencies for Java" }, "nbformat": 4, "nbformat_minor": 5 diff --git a/jupyter/ExternalDependenciesTypescript.ipynb b/jupyter/ExternalDependenciesTypescript.ipynb index 69ee70089..a6d80e822 100644 --- a/jupyter/ExternalDependenciesTypescript.ipynb +++ b/jupyter/ExternalDependenciesTypescript.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# External Dependencies\n", + "# External Dependencies for Typescript\n", "
\n", "\n", "### References\n", @@ -109,6 +109,41 @@ " return result_data_frame.sort_values(by=percent_column_name, ascending=False);" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "fe7da2e1", + "metadata": {}, + "outputs": [], + "source": [ + "def filter_values_below_threshold(data_frame : pd.DataFrame, value_column : str, upper_limit: float = 100.0) -> pd.DataFrame: \n", + " \"\"\"\n", + " Adds a new percentage column for the value column and \n", + " groups all values below the given threshold to \"others\" in the name column.\n", + "\n", + " Parameters:\n", + " - data_frame (pd.DataFrame): Input pandas DataFrame\n", + " - value_column (str): Name of the column that contains the numeric value\n", + " - upper_limit (float): Defaults to 100%. Filters out all entries exceeding this limit. Intended to drill down \"others\" in a second chart/table.\n", + "\n", + " Returns:\n", + " int:Returning value\n", + "\n", + " \"\"\"\n", + " result_data_frame = data_frame.copy();\n", + "\n", + " percent_column_name = value_column + 'Percent';\n", + "\n", + " # Add column with the name given in \"percent_column_name\" with the percentage of the value column.\n", + " result_data_frame[percent_column_name] = result_data_frame[value_column] / result_data_frame[value_column].sum() * 100.0;\n", + "\n", + " # Limit entries to meet the an optional upper limit (in percentage)\n", + " result_data_frame = result_data_frame.query(\"`\" + percent_column_name + \"` <= \" + str(upper_limit))\n", + "\n", + " result_data_frame = result_data_frame.reset_index(drop=True)\n", + " return result_data_frame.sort_values(by=percent_column_name, ascending=False);" + ] + }, { "cell_type": "code", "execution_count": null, @@ -283,7 +318,7 @@ "id": "1143afcb", "metadata": {}, "source": [ - "#### Table 1 Chart 1 - Most called external modules in % by internal elements\n", + "#### Table 1 Chart 1a - Most called external modules in % by internal elements (more than 0.7% overall)\n", "\n", "External modules that are used less than 0.7% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external modules and how ofter they are called by internal elements in percent." @@ -304,7 +339,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_module_by_internal_element_usage_significant,\n", - " title='Top external module usage [%] by internal elements'\n", + " title='Top external module usage [%] by internal elements (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "d59d7924", + "metadata": {}, + "source": [ + "#### Table 1 Chart 1b - Most called external modules in % by internal elements (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external modules. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "81be06d7", + "metadata": {}, + "outputs": [], + "source": [ + "external_module_by_internal_element_usage_drill_down_others=filter_values_below_threshold(external_module_usage, 'numberOfExternalCallerElements', 0.7)\n", + "\n", + "external_module_by_internal_element_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_module_by_internal_element_usage_drill_down_others,\n", + " value_column='numberOfExternalCallerElements',\n", + " name_column='externalModuleName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_module_by_internal_element_usage_significant_drill_down_others,\n", + " title='Top external module usage [%] by internal elements (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -313,7 +379,7 @@ "id": "84c123dc", "metadata": {}, "source": [ - "#### Table 1 Chart 2 - Most called external modules in % by internal modules\n", + "#### Table 1 Chart 2a - Most called external modules in % by internal modules (more than 0.7% overall)\n", "\n", "External modules that are used less than 0.7% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external modules and how ofter they are called by internal modules in percent." @@ -334,7 +400,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_module_used_by_internal_modules_significant,\n", - " title='Top external module usage [%] by internal modules'\n", + " title='Top external module usage [%] by internal modules (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "a5a33ad1", + "metadata": {}, + "source": [ + "#### Table 1 Chart 2b - Most called external modules in % by internal modules (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external modules. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "72104f22", + "metadata": {}, + "outputs": [], + "source": [ + "external_module_used_by_internal_modules_drill_down_others=filter_values_below_threshold(external_module_usage, 'numberOfExternalCallerModules', 0.7)\n", + "\n", + "external_module_used_by_internal_modules_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_module_used_by_internal_modules_drill_down_others,\n", + " value_column='numberOfExternalCallerModules',\n", + " name_column='externalModuleName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_module_used_by_internal_modules_significant_drill_down_others,\n", + " title='Top external module usage [%] by internal modules (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -379,7 +476,7 @@ "id": "279932a6", "metadata": {}, "source": [ - "#### Table 2 Chart 1 - Most called external namespaces in % by internal element\n", + "#### Table 2 Chart 1a - Most called external namespaces in % by internal element (more than 0.7% overall)\n", "\n", "External namespaces that are used less than 0.7% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external namespaces and how ofter they are called by internal elements in percent." @@ -400,7 +497,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_namespace_use_by_internal_elements_significantly,\n", - " title='Top external namespace usage [%] by internal elements'\n", + " title='Top external namespace usage [%] by internal elements (more than 0.7% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "1372eff1", + "metadata": {}, + "source": [ + "#### Table 2 Chart 1a - Most called external namespaces in % by internal element (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external namespaces. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0ef25c8e", + "metadata": {}, + "outputs": [], + "source": [ + "external_namespace_use_by_internal_elements_drill_down_others=filter_values_below_threshold(external_namespace_usage, 'numberOfExternalCallerElements', 0.7)\n", + "\n", + "external_namespace_use_by_internal_elements_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_namespace_use_by_internal_elements_drill_down_others,\n", + " value_column='numberOfExternalCallerElements',\n", + " name_column='externalNamespaceName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_namespace_use_by_internal_elements_significant_drill_down_others,\n", + " title='Top external namespace usage [%] by internal elements (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -409,7 +537,7 @@ "id": "43c3e1a3", "metadata": {}, "source": [ - "#### Table 2 Chart 2 - Most called external namespaces in % by internal modules\n", + "#### Table 2 Chart 2a - Most called external namespaces in % by internal modules (more than 0.7% overall)\n", "\n", "External namespaces that are used less than 0.7% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external namespaces and how ofter they are called by internal modules in percent." @@ -430,18 +558,39 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_namespace_used_by_internal_modules_significantly,\n", - " title='Top external namespace usage [%] by internal modules'\n", + " title='Top external namespace usage [%] by internal modules (more than 0.7% overall)'\n", ")" ] }, + { + "cell_type": "markdown", + "id": "665ba73f", + "metadata": {}, + "source": [ + "#### Table 2 Chart 2b - Most called external namespaces in % by internal modules (less than 0.7% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.7% overall) most called external namespaces. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, { "cell_type": "code", "execution_count": null, - "id": "590ee6a7", + "id": "8107fd74", "metadata": {}, "outputs": [], "source": [ - "type(external_namespace_used_by_internal_modules_significantly)" + "external_namespace_used_by_internal_modules_drill_down_others=filter_values_below_threshold(external_namespace_usage, 'numberOfExternalCallerModules', 0.7)\n", + "\n", + "external_namespace_used_by_internal_modules_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_namespace_used_by_internal_modules_drill_down_others,\n", + " value_column='numberOfExternalCallerModules',\n", + " name_column='externalNamespaceName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_namespace_used_by_internal_modules_significant_drill_down_others,\n", + " title='Top external namespace usage [%] by internal modules (less than 0.7% overall \"others\" drill-down)'\n", + ")" ] }, { @@ -576,9 +725,9 @@ "id": "b210eea0", "metadata": {}, "source": [ - "#### Table 3 Chart 1 - Most widely spread external packages in % by types\n", + "#### Table 3 Chart 1a - Most widely spread external module in % by internal elements (more than 0.5% overall)\n", "\n", - "External packages that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external packages." + "External modules that are used less than 0.5% are grouped into the name \"others\" to get a cleaner chart with the most significant external module." ] }, { @@ -596,7 +745,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_module_by_internal_element_usage_spread_significant,\n", - " title='Top external module usage spread [%] by internal elements'\n", + " title='Top external module usage spread [%] by internal elements (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "02b7f814", + "metadata": {}, + "source": [ + "#### Table 3 Chart 1b - Most widely spread external modules in % by types (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most widely spread external modules. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a63c9a4", + "metadata": {}, + "outputs": [], + "source": [ + "external_module_by_internal_element_usage_spread_drill_down_others=filter_values_below_threshold(external_module_usage_spread, 'sumNumberOfInternalElements', 0.5)\n", + "\n", + "external_module_by_internal_element_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_module_by_internal_element_usage_spread_drill_down_others,\n", + " value_column='sumNumberOfInternalElements',\n", + " name_column='externalModuleName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_module_by_internal_element_usage_spread_significant_drill_down_others,\n", + " title='Top external module usage spread [%] by internal elements (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -605,7 +785,7 @@ "id": "c48740e3", "metadata": {}, "source": [ - "#### Table 3 Chart 2 - Most widely spread external modules in % by internal modules\n", + "#### Table 3 Chart 2a - Most widely spread external modules in % by internal modules (more than 0.5% overall)\n", "\n", "External modules that are used less than 0.5% are grouped into \"others\" to get a cleaner chart containing the most significant external modules." ] @@ -625,7 +805,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_modules_used_by_internal_modules_spread_significant,\n", - " title='Top external module usage spread [%] by internal modules'\n", + " title='Top external module usage spread [%] by internal modules (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "4aa7569b", + "metadata": {}, + "source": [ + "#### Table 3 Chart 2b - Most widely spread external modules in % by internal modules (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most widely spread external modules. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0ce91cf2", + "metadata": {}, + "outputs": [], + "source": [ + "external_modules_used_by_internal_modules_spread_drill_down_others=filter_values_below_threshold(external_module_usage_spread, 'numberOfInternalModules', 0.5)\n", + "\n", + "external_modules_used_by_internal_modules_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_modules_used_by_internal_modules_spread_drill_down_others,\n", + " value_column='numberOfInternalModules',\n", + " name_column='externalModuleName',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_modules_used_by_internal_modules_spread_significant_drill_down_others,\n", + " title='Top external module usage spread [%] by internal modules (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -703,7 +914,7 @@ "id": "04840973", "metadata": {}, "source": [ - "#### Table 4 Chart 1 - Most widely spread external namespaces in % by internal element\n", + "#### Table 4 Chart 1a - Most widely spread external namespaces in % by internal element (less than 0.5% overall)\n", "\n", "External namespaces that are used less than 0.5% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external namespaces and how ofter they are called in percent." @@ -724,7 +935,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_namespace_usage_significant,\n", - " title='Top external namespace usage spread [%] by internal elements'\n", + " title='Top external namespace usage spread [%] by internal elements (less than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "f9d4eadb", + "metadata": {}, + "source": [ + "#### Table 4 Chart 1b - Most widely spread external namespaces in % by internal element (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most widely spread external namespaces. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cdd53bf", + "metadata": {}, + "outputs": [], + "source": [ + "external_namespace_usage_spread_drill_down_others=filter_values_below_threshold(external_namespace_usage_spread, 'sumNumberOfInternalElements', 0.5)\n", + "\n", + "external_namespace_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_namespace_usage_spread_drill_down_others,\n", + " value_column='sumNumberOfInternalElements',\n", + " name_column='externalModuleNamespace',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_namespace_usage_spread_significant_drill_down_others,\n", + " title='Top external namespace usage spread [%] by internal elements (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -733,7 +975,7 @@ "id": "fb678b02", "metadata": {}, "source": [ - "#### Table 4 Chart 2 - Most widely spread external namespace in % by internal modules\n", + "#### Table 4 Chart 2a - Most widely spread external namespace in % by internal modules (more than 0.5% overall)\n", "\n", "External namespaces that are used less than 0.5% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external namespaces and how ofter they are called in percent." @@ -754,7 +996,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_namespace_internal_module_usage_spread_significant,\n", - " title='Top external namespace usage spread [%] by internal modules'\n", + " title='Top external namespace usage spread [%] by internal modules (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "e766c689", + "metadata": {}, + "source": [ + "#### Table 4 Chart 2b - Most widely spread external namespace in % by internal modules (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) most widely spread external namespaces. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "99dc8d15", + "metadata": {}, + "outputs": [], + "source": [ + "external_namespace_internal_module_usage_spread_drill_down_others=filter_values_below_threshold(external_namespace_usage_spread, 'numberOfInternalModules', 0.5)\n", + "\n", + "external_namespace_internal_module_usage_spread_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_namespace_internal_module_usage_spread_drill_down_others,\n", + " value_column='numberOfInternalModules',\n", + " name_column='externalModuleNamespace',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_namespace_internal_module_usage_spread_significant_drill_down_others,\n", + " title='Top external namespace usage spread [%] by internal modules (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -763,7 +1036,7 @@ "id": "14e4da22", "metadata": {}, "source": [ - "#### Table 4 Chart 3 - External namespaces with the most used declarations in %\n", + "#### Table 4 Chart 3a - External namespaces with the most used declarations in % (more than 0.5% overall)\n", "\n", "External namespaces that are used less than 0.5% are grouped into \"others\" to get a cleaner chart\n", "containing the most significant external namespaces and how ofter they are called in percent." @@ -784,7 +1057,38 @@ ");\n", "plot_pie_chart(\n", " input_data_frame=external_namespace_declaration_usage_significant,\n", - " title='Top external namespace declaration usage [%]'\n", + " title='Top external namespace declaration usage [%] (more than 0.5% overall)'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "1b527d90", + "metadata": {}, + "source": [ + "#### Table 4 Chart 3b - External namespaces with the most used declarations in % (less than 0.5% overall \"others\" drill-down)\n", + "\n", + "Shows the lowest (less than 0.5% overall) external namespaces with the most used declarations. Therefore, this plot breaks down the \"others\" slice of the pie chart above. Values under 0.3% from that will be grouped into \"others\" to get a cleaner plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f3008e7", + "metadata": {}, + "outputs": [], + "source": [ + "external_namespace_declaration_usage_drill_down_others=filter_values_below_threshold(external_namespace_usage_spread, 'sumNumberOfUsedExternalDeclarations', 0.5)\n", + "\n", + "external_namespace_declaration_usage_significant_drill_down_others = group_to_others_below_threshold(\n", + " data_frame=external_namespace_declaration_usage_drill_down_others,\n", + " value_column='sumNumberOfUsedExternalDeclarations',\n", + " name_column='externalModuleNamespace',\n", + " threshold= 0.3\n", + ")\n", + "plot_pie_chart(\n", + " input_data_frame=external_namespace_declaration_usage_significant_drill_down_others,\n", + " title='Top external namespace declaration usage (less than 0.7% overall \"others\" drill-down)'\n", ")" ] }, @@ -1316,7 +1620,7 @@ }, { "cell_type": "code", - "execution_count": 426, + "execution_count": null, "id": "46baa3c1", "metadata": {}, "outputs": [], @@ -1350,7 +1654,7 @@ "pygments_lexer": "ipython3", "version": "3.11.9" }, - "title": "Object Oriented Design Quality Metrics for Java with Neo4j" + "title": "External Dependencies for Typescript" }, "nbformat": 4, "nbformat_minor": 5