diff --git a/README.md b/README.md index 70ca39022..7e57640a8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Code Graph Analysis Pipeline - + -Contained within this repository is a comprehensive and automated code graph analysis pipeline. While initially designed to support Java through the utilization of [jQAssistant](https://jqassistant.org/get-started), its capabilities extend beyond that particular language. The graph database [Neo4j](https://neo4j.com) serves as the foundation for storing and querying the graph, which encompasses all the structural intricacies of the analyzed code. Additionally, Neo4j's [Graph Data Science](https://neo4j.com/product/graph-data-science) integration maximizes the utilization of its features. The generated reports offer flexibility, ranging from simple query results presented as CSV files to more elaborate Jupyter Notebooks converted to Markdown or PDF formats. +Contained within this repository is a comprehensive and automated code graph analysis pipeline. While initially designed to support Java through the utilization of [jQAssistant](https://jqassistant.org/get-started), it is open to extension for further programming languages. The graph database [Neo4j](https://neo4j.com) serves as the foundation for storing and querying the graph, which encompasses all the structural intricacies of the analyzed code. Additionally, Neo4j's [Graph Data Science](https://neo4j.com/product/graph-data-science) provides additional algorithms like community detection to analyze the code structure. The generated reports offer flexibility, ranging from simple query results presented as CSV files to more elaborate Jupyter Notebooks converted to Markdown or PDF formats. --- @@ -16,12 +16,12 @@ Contained within this repository is a comprehensive and automated code graph ana ### 📖 Jupyter Notebook Reports -- [External Dependencies](./jupyter/ExternalDependencies.ipynb) reports with amongst others the most and least used external packages ([Example](./results/AxonFramework-4.7.5/external-dependencies/ExternalDependencies.md)) -- [Object Oriented Design Quality Metrics](./jupyter/ObjectOrientedDesignMetrics.ipynb) report based on [OO Design Quality Metrics by Robert Martin](https://www.semanticscholar.org/paper/OO-Design-Quality-Metrics-Martin-October/18acd7eb21b918c8a5f619157f7e4f6d451d18f8) ([Example](./results/AxonFramework-4.7.5/object-oriented-design-metrics/ObjectOrientedDesignMetrics.md)) -- [Overview](./jupyter/Overview.ipynb) reports with the number of Java types and packages, method line count, etc. ([Example](./results/AxonFramework-4.7.5/overview/Overview.md)) -- [Package Dependencies](./jupyter/PackageDependencies.ipynb) report based on [Analyze java package metrics in a graph database](https://joht.github.io/johtizen/data/2023/04/21/java-package-metrics-analysis.html) including cyclic dependencies ([Example](./results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.md)) -- [Visibility Metrics](./jupyter/VisibilityMetrics.ipynb) reports based on [Visibility Metrics and the Importance of Hiding Things](https://dzone.com/articles/visibility-metrics-and-the-importance-of-hiding-th) ([Example](./results/AxonFramework-4.7.5/visibility-metrics/VisibilityMetrics.md)) -- [Wordcloud](./jupyter/Wordcloud.ipynb) with a visual representation of Java package and class names ([Example](./results/AxonFramework-4.7.5/wordcloud/Wordcloud.md)) +- [External Dependencies](./jupyter/ExternalDependencies.ipynb) contains the most and least used external packages, etc. ([Example](./results/AxonFramework-4.7.5/external-dependencies/ExternalDependencies.md)) +- [Object Oriented Design Quality Metrics](./jupyter/ObjectOrientedDesignMetrics.ipynb) is based on [OO Design Quality Metrics by Robert Martin](https://www.semanticscholar.org/paper/OO-Design-Quality-Metrics-Martin-October/18acd7eb21b918c8a5f619157f7e4f6d451d18f8) ([Example](./results/AxonFramework-4.7.5/object-oriented-design-metrics/ObjectOrientedDesignMetrics.md)) +- [Overview](./jupyter/Overview.ipynb) contains the number of types and packages, method line count, cyclomatic complexity, etc. ([Example](./results/AxonFramework-4.7.5/overview/Overview.md)) +- [Internal Dependencies](./jupyter/InternalDependencies.ipynb) is based on [Analyze java package metrics in a graph database](https://joht.github.io/johtizen/data/2023/04/21/java-package-metrics-analysis.html) including cyclic dependencies ([Example](./results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.md)) +- [Visibility Metrics](./jupyter/VisibilityMetrics.ipynb) is based on [Visibility Metrics and the Importance of Hiding Things](https://dzone.com/articles/visibility-metrics-and-the-importance-of-hiding-th) ([Example](./results/AxonFramework-4.7.5/visibility-metrics/VisibilityMetrics.md)) +- [Wordcloud](./jupyter/Wordcloud.ipynb) contains a visual representation of package and class names ([Example](./results/AxonFramework-4.7.5/wordcloud/Wordcloud.md)) ### 📖 Graph Data Science Reports @@ -36,20 +36,19 @@ Here are some reports that utilize Neo4j's [Graph Data Science Library](https:// - [External Dependencies (CSV)](./scripts/reports/ExternalDependenciesCsv.sh) ([Example](./results/AxonFramework-4.7.5/external-dependencies-csv/External_package_usage_overall.csv)) - [Object Oriented Design Metrics (CSV)](./scripts/reports/ObjectOrientedDesignMetricsCsv.sh) ([Example](./results/AxonFramework-4.7.5/object-oriented-design-metrics-csv/MainSequenceAbstractnessInstabilityDistance.csv)) - [Overview (CSV)](./scripts/reports/OverviewCsv.sh) ([Example](./results/AxonFramework-4.7.5/overview-csv/Cyclomatic_Method_Complexity.csv)) -- [Package Dependencies - Cyclic (CSV)](./scripts/reports/PackageDependenciesCsv.sh) ([Example](./results/AxonFramework-4.7.5/package-dependencies-csv/CyclicDependenciesUnwinded.csv)) -- [Package Dependencies - Interface Segregation (CSV)](./scripts/reports/PackageDependenciesCsv.sh) ([Example](./results/AxonFramework-4.7.5/package-dependencies-csv/InterfaceSegregationCandidates.csv)) +- [Internal Dependencies - Cyclic (CSV)](./scripts/reports/InternalDependenciesCsv.sh) ([Example](./results/AxonFramework-4.7.5/internal-dependencies-csv/CyclicDependenciesUnwinded.csv)) +- [Internal Dependencies - Interface Segregation (CSV)](./scripts/reports/InternalDependenciesCsv.sh) ([Example](./results/AxonFramework-4.7.5/internal-dependencies-csv/InterfaceSegregationCandidates.csv)) - [Visibility Metrics (CSV)](./scripts/reports/VisibilityMetricsCsv.sh) ([Example](./results/AxonFramework-4.7.5/visibility-metrics-csv/RelativeVisibilityPerArtifact.csv)) ## 🛠 Prerequisites -- Java 11 is required (June 2023 Neo4j 4.x requirement) -- Python with a conda package manager is needed for Jupyter Notebook reports -- Chromium will automatically be downloaded if needed for Jupyter Notebook reports in PDF format. +- Java 17 is required (June 2023 Neo4j 5.x requirement) +- Python and a conda package manager are required for Jupyter Notebook reports +- Chromium will automatically be downloaded if needed for Jupyter Notebook reports in PDF format ## Getting Started -See [Start an analysis](./COMMANDS.md#start-an-analysis) in the [Commands Reference](./COMMANDS.md) on how to start -an analysis on your local machine. +See [Start an analysis](./COMMANDS.md#start-an-analysis) in the [Commands Reference](./COMMANDS.md) on how to start an analysis on your local machine. ## 🏗 Pipeline and Tools diff --git a/cypher/Cyclic_Dependencies/Cyclic_Dependencies_between_Artrifacts_as_unwinded_List.cypher b/cypher/Cyclic_Dependencies/Cyclic_Dependencies_between_Artrifacts_as_unwinded_List.cypher new file mode 100644 index 000000000..2da2fc856 --- /dev/null +++ b/cypher/Cyclic_Dependencies/Cyclic_Dependencies_between_Artrifacts_as_unwinded_List.cypher @@ -0,0 +1,36 @@ +//Cyclic Dependencies between Artifacts as unwinded List + +MATCH (package:Package)-[:CONTAINS]->(forwardSource:Type)-[:DEPENDS_ON]->(forwardTarget:Type)<-[:CONTAINS]-(dependentPackage:Package) +MATCH (dependentPackage)-[:CONTAINS]->(backwardSource:Type)-[:DEPENDS_ON]->(backwardTarget:Type)<-[:CONTAINS]-(package) +MATCH (artifact:Artifact)-[:CONTAINS]->(package) +MATCH (dependentArtifact:Artifact)-[:CONTAINS]->(dependentPackage) + WITH artifact + ,dependentArtifact + ,package + ,dependentPackage + ,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies + ,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies + WITH artifact + ,dependentArtifact + ,package + ,dependentPackage + ,forwardDependencies + ,backwardDependencies + ,size(forwardDependencies) AS numberOfForwardDependencies + ,size(backwardDependencies) AS numberOfBackwardDependencies + ,size(forwardDependencies) + size(backwardDependencies) AS numberOfAllCyclicDependencies +WHERE artifact <> dependentArtifact + AND package <> dependentPackage + AND (size(forwardDependencies) > size(backwardDependencies) + OR (size(forwardDependencies) = size(backwardDependencies) + AND size(package.fqn) >= size(dependentPackage.fqn))) +UNWIND (backwardDependencies + forwardDependencies) AS dependency +RETURN artifact.fileName AS artifactName + ,dependentArtifact.fileName AS dependentArtifactName + ,package.fqn AS packageName + ,dependentPackage.fqn AS dependentPackageName + ,dependency + ,toFloat(ABS(numberOfForwardDependencies - numberOfBackwardDependencies)) / numberOfAllCyclicDependencies AS forwardToBackwardBalance + ,numberOfForwardDependencies AS numberForward + ,numberOfBackwardDependencies AS numberBackward +ORDER BY forwardToBackwardBalance DESC, packageName ASC \ No newline at end of file diff --git a/images/DALL-E-Mini-Graph-Pipeline-Logo-2.png b/images/DALL-E-Mini-Graph-Pipeline-Logo-2.png new file mode 100644 index 000000000..db34bfa69 Binary files /dev/null and b/images/DALL-E-Mini-Graph-Pipeline-Logo-2.png differ diff --git a/jupyter/ExternalDependencies.ipynb b/jupyter/ExternalDependencies.ipynb index 656ce828f..78d0b563e 100644 --- a/jupyter/ExternalDependencies.ipynb +++ b/jupyter/ExternalDependencies.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# External Dependencies of Java Artifacts with Neo4j\n", + "# External Dependencies\n", "
\n", "\n", "### References\n", diff --git a/jupyter/PackageDependencies.ipynb b/jupyter/InternalDependencies.ipynb similarity index 99% rename from jupyter/PackageDependencies.ipynb rename to jupyter/InternalDependencies.ipynb index 316a3a0d1..0bf1ad810 100644 --- a/jupyter/PackageDependencies.ipynb +++ b/jupyter/InternalDependencies.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# Package Dependencies for Java with Neo4j\n", + "# Internal Dependencies\n", "
\n", "\n", "### References\n", diff --git a/jupyter/ObjectOrientedDesignMetrics.ipynb b/jupyter/ObjectOrientedDesignMetrics.ipynb index acea35db4..98c4a8870 100644 --- a/jupyter/ObjectOrientedDesignMetrics.ipynb +++ b/jupyter/ObjectOrientedDesignMetrics.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# Object Oriented Design Quality Metrics for Java with Neo4j\n", + "# Object Oriented Design Quality Metrics\n", "
\n", "\n", "### References\n", diff --git a/jupyter/Overview.ipynb b/jupyter/Overview.ipynb index 709262cd5..a21bc127f 100644 --- a/jupyter/Overview.ipynb +++ b/jupyter/Overview.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# Overview of Java Artifacts with Neo4j\n", + "# Overview\n", "
\n", "\n", "### References\n", diff --git a/jupyter/VisibilityMetrics.ipynb b/jupyter/VisibilityMetrics.ipynb index 31e8227de..4916d6ee1 100644 --- a/jupyter/VisibilityMetrics.ipynb +++ b/jupyter/VisibilityMetrics.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# Visibility Metrics for Java with Neo4j\n", + "# Visibility Metrics\n", "
\n", "\n", "### References\n", diff --git a/jupyter/Wordcloud.ipynb b/jupyter/Wordcloud.ipynb index a719b1b22..ede83c7d9 100644 --- a/jupyter/Wordcloud.ipynb +++ b/jupyter/Wordcloud.ipynb @@ -6,7 +6,7 @@ "id": "2f0eabc4", "metadata": {}, "source": [ - "# Overview of Java Artifacts with Neo4j\n", + "# Wordcloud\n", "
\n", "\n", "### References\n", diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/ArtifactPackageUsage.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/ArtifactPackageUsage.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/ArtifactPackageUsage.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/ArtifactPackageUsage.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/ClassesPerPackageUsageAcrossArtifacts.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/ClassesPerPackageUsageAcrossArtifacts.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/ClassesPerPackageUsageAcrossArtifacts.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/ClassesPerPackageUsageAcrossArtifacts.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/CyclicDependencies.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/CyclicDependencies.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/CyclicDependencies.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/CyclicDependencies.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/CyclicDependenciesUnwinded.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/CyclicDependenciesUnwinded.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/CyclicDependenciesUnwinded.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/CyclicDependenciesUnwinded.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/InterfaceSegregationCandidates.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/InterfaceSegregationCandidates.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/InterfaceSegregationCandidates.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/InterfaceSegregationCandidates.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies-csv/WidelyUsedTypes.csv b/results/AxonFramework-4.7.5/internal-dependencies-csv/WidelyUsedTypes.csv similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies-csv/WidelyUsedTypes.csv rename to results/AxonFramework-4.7.5/internal-dependencies-csv/WidelyUsedTypes.csv diff --git a/results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.ipynb b/results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.ipynb similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.ipynb rename to results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.ipynb diff --git a/results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.md b/results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.md similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.md rename to results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.md diff --git a/results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.pdf b/results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.pdf similarity index 100% rename from results/AxonFramework-4.7.5/package-dependencies/PackageDependencies.pdf rename to results/AxonFramework-4.7.5/internal-dependencies/InternalDependencies.pdf diff --git a/scripts/SCRIPTS.md b/scripts/SCRIPTS.md index c1cf0011b..639c68f17 100644 --- a/scripts/SCRIPTS.md +++ b/scripts/SCRIPTS.md @@ -23,14 +23,14 @@ Script | Directory | Description | [CentralityCsv.sh](./reports/CentralityCsv.sh) | reports | Looks for centrality using the Graph Data Science Library of Neo4j and creates CSV reports. | | [CommunityCsv.sh](./reports/CommunityCsv.sh) | reports | Detects communities using the Graph Data Science Library of Neo4j and creates CSV reports. | | [DatabaseCsvExport.sh](./reports/DatabaseCsvExport.sh) | reports | Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all" | -| [ExternalDependenciesCsv.sh](./reports/ExternalDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. | +| [ExternalDependenciesCsv.sh](./reports/ExternalDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "external-dependencies-csv" CSV reports. | | [ExternalDependenciesJupyter.sh](./reports/ExternalDependenciesJupyter.sh) | reports | Creates the "overview" report (ipynb, md, pdf) based on the Jupyter Notebook "Overview.ipynb". | +| [InternalDependenciesCsv.sh](./reports/InternalDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "internal-dependencies" CSV reports. | +| [InternalDependenciesJupyter.sh](./reports/InternalDependenciesJupyter.sh) | reports | Creates the "internal-dependencies" report (ipynb, md, pdf) based on the Jupyter Notebook "InternalDependencies.ipynb". | | [ObjectOrientedDesignMetricsCsv.sh](./reports/ObjectOrientedDesignMetricsCsv.sh) | reports | Executes "Metrics" Cypher queries to get the "object-oriented-design-metrics" CSV reports. | | [ObjectOrientedDesignMetricsJupyter.sh](./reports/ObjectOrientedDesignMetricsJupyter.sh) | reports | Creates the "object-oriented-design-metrics" report (ipynb, md, pdf) based on the Jupyter Notebook "ObjectOrientedDesignMetrics.ipynb". | -| [OverviewCsv.sh](./reports/OverviewCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. | +| [OverviewCsv.sh](./reports/OverviewCsv.sh) | reports | Executes "Overview" Cypher queries to get the "overview-csv" CSV reports. | | [OverviewJupyter.sh](./reports/OverviewJupyter.sh) | reports | Creates the "overview" report (ipynb, md, pdf) based on the Jupyter Notebook "Overview.ipynb". | -| [PackageDependenciesCsv.sh](./reports/PackageDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. | -| [PackageDependenciesJupyter.sh](./reports/PackageDependenciesJupyter.sh) | reports | Creates the "package-dependencies" report (ipynb, md, pdf) based on the Jupyter Notebook "PackageDependencies.ipynb". | | [SimilarityCsv.sh](./reports/SimilarityCsv.sh) | reports | Looks for similarity using the Graph Data Science Library of Neo4j and creates CSV reports. | | [VisibilityMetricsCsv.sh](./reports/VisibilityMetricsCsv.sh) | reports | Executes "Visibility" Cypher queries to get the "visibility-metrics" CSV reports. | | [VisibilityMetricsJupyter.sh](./reports/VisibilityMetricsJupyter.sh) | reports | Creates the "visibility-metrics" report (ipynb, md, pdf) based on the Jupyter Notebook "VisibilityMetrics.ipynb". | @@ -40,7 +40,6 @@ Script | Directory | Description | [JupyterReports.sh](./reports/compilations/JupyterReports.sh) | compilations | Runs all Jupyter Notebook report scripts. | | [resetAndScan.sh](./resetAndScan.sh) | | Deletes all data in the Neo4j graph database and rescans the downloaded artifacts to create a new graph. | | [resetAndScanChanged.sh](./resetAndScanChanged.sh) | | Executes "resetAndScan.sh" only if "detectChangedArtifacts.sh" returns detected changes. | -| [resetAndScanMemgraph.sh](./resetAndScanMemgraph.sh) | | Deletes all data in the Neo4j graph database and rescans the downloaded artifacts to create a new graph. | | [setupJQAssistant.sh](./setupJQAssistant.sh) | | Installs (download and unzip) jQAssistant (https://jqassistant.org/get-started). | | [setupNeo4j.sh](./setupNeo4j.sh) | | Installs (download, unpack, get plugins, configure) a local Neo4j Graph Database (https://neo4j.com/download-center/#community). | | [setupNeo4jInitialPassword.sh](./setupNeo4jInitialPassword.sh) | | Sets the initial password for the local Neo4j Graph Database (https://neo4j.com/download-center/#community). | diff --git a/scripts/reports/ExternalDependenciesCsv.sh b/scripts/reports/ExternalDependenciesCsv.sh index 0ccac5a42..a77eb1ff7 100755 --- a/scripts/reports/ExternalDependenciesCsv.sh +++ b/scripts/reports/ExternalDependenciesCsv.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash -# Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. -# It contains lists of e.g. incoming and outgoing package dependencies, -# abstractness, instability and the distance to the so called "main sequence". +# Executes "Package_Usage" Cypher queries to get the "external-dependencies-csv" CSV reports. +# They list external library package usage like how often a external package is called. # Overrideable Constants (defaults also defined in sub scripts) REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"} diff --git a/scripts/reports/PackageDependenciesCsv.sh b/scripts/reports/InternalDependenciesCsv.sh similarity index 83% rename from scripts/reports/PackageDependenciesCsv.sh rename to scripts/reports/InternalDependenciesCsv.sh index e7de539e6..23af6afbe 100755 --- a/scripts/reports/PackageDependenciesCsv.sh +++ b/scripts/reports/InternalDependenciesCsv.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. +# Executes "Package_Usage" Cypher queries to get the "internal-dependencies" CSV reports. # It contains lists of e.g. incoming and outgoing package dependencies, # abstractness, instability and the distance to the so called "main sequence". @@ -12,21 +12,21 @@ REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"} # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} -echo "PackageDependenciesCsv: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}" +echo "InternalDependenciesCsv: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}" # Get the "scripts" directory by taking the path of this script and going one directory up. SCRIPTS_DIR=${SCRIPTS_DIR:-"${REPORTS_SCRIPT_DIR}/.."} -echo "PackageDependenciesCsv SCRIPTS_DIR=${SCRIPTS_DIR}" +echo "InternalDependenciesCsv SCRIPTS_DIR=${SCRIPTS_DIR}" # Get the "cypher" directory by taking the path of this script and going two directory up and then to "cypher". CYPHER_DIR=${CYPHER_DIR:-"${REPORTS_SCRIPT_DIR}/../../cypher"} -echo "PackageDependenciesCsv CYPHER_DIR=${CYPHER_DIR}" +echo "InternalDependenciesCsv CYPHER_DIR=${CYPHER_DIR}" # Define functions to execute cypher queries from within a given file source "${SCRIPTS_DIR}/executeQueryFunctions.sh" # Create report directory -REPORT_NAME="package-dependencies-csv" +REPORT_NAME="internal-dependencies-csv" FULL_REPORT_DIRECTORY="${REPORTS_DIRECTORY}/${REPORT_NAME}" mkdir -p "${FULL_REPORT_DIRECTORY}" @@ -36,6 +36,7 @@ PACKAGE_USAGE_CYPHER_DIR="${CYPHER_DIR}/Package_Usage" execute_cypher "${CYCLIC_DEPENDENCIES_CYPHER_DIR}/Cyclic_Dependencies_as_List.cypher" > "${FULL_REPORT_DIRECTORY}/CyclicDependencies.csv" execute_cypher "${CYCLIC_DEPENDENCIES_CYPHER_DIR}/Cyclic_Dependencies_as_unwinded_List.cypher" > "${FULL_REPORT_DIRECTORY}/CyclicDependenciesUnwinded.csv" +execute_cypher "${CYCLIC_DEPENDENCIES_CYPHER_DIR}/Cyclic_Dependencies_between_Artrifacts_as_unwinded_List.cypher" > "${FULL_REPORT_DIRECTORY}/CyclicArtifactDependenciesUnwinded.csv" execute_cypher "${CYPHER_DIR}/Candidates_for_Interface_Segregation.cypher" > "${FULL_REPORT_DIRECTORY}/InterfaceSegregationCandidates.csv" execute_cypher "${PACKAGE_USAGE_CYPHER_DIR}/List_types_that_are_used_by_many_different_packages.cypher" > "${FULL_REPORT_DIRECTORY}/WidelyUsedTypes.csv" execute_cypher "${PACKAGE_USAGE_CYPHER_DIR}/How_many_packages_compared_to_all_existing_are_used_by_dependent_artifacts.cypher" > "${FULL_REPORT_DIRECTORY}/ArtifactPackageUsage.csv" diff --git a/scripts/reports/PackageDependenciesJupyter.sh b/scripts/reports/InternalDependenciesJupyter.sh similarity index 69% rename from scripts/reports/PackageDependenciesJupyter.sh rename to scripts/reports/InternalDependenciesJupyter.sh index 7b6020f04..4eae5802f 100755 --- a/scripts/reports/PackageDependenciesJupyter.sh +++ b/scripts/reports/InternalDependenciesJupyter.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Creates the "package-dependencies" report (ipynb, md, pdf) based on the Jupyter Notebook "PackageDependencies.ipynb". +# Creates the "internal-dependencies" report (ipynb, md, pdf) based on the Jupyter Notebook "InternalDependencies.ipynb". # It contains lists of e.g. cyclic dependencies, dependencies that are only used by a few packages, # classes that are used by many different packages and some more. @@ -12,20 +12,20 @@ REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"} # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} -echo "PackageDependenciesJupyter: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}" +echo "InternalDependenciesJupyter: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}" # Get the "scripts" directory by taking the path of this script and going one directory up. SCRIPTS_DIR=${SCRIPTS_DIR:-"${REPORTS_SCRIPT_DIR}/.."} -echo "PackageDependenciesJupyter: SCRIPTS_DIR=${SCRIPTS_DIR}" +echo "InternalDependenciesJupyter: SCRIPTS_DIR=${SCRIPTS_DIR}" # Get the "jupyter" directory by taking the path of this script and going two directory up and then to "jupyter". JUPYTER_NOTEBOOK_DIRECTORY=${JUPYTER_NOTEBOOK_DIRECTORY:-"${SCRIPTS_DIR}/../jupyter"} -echo "PackageDependenciesJupyter: JUPYTER_NOTEBOOK_DIRECTORY=$JUPYTER_NOTEBOOK_DIRECTORY" +echo "InternalDependenciesJupyter: JUPYTER_NOTEBOOK_DIRECTORY=$JUPYTER_NOTEBOOK_DIRECTORY" # Create report directory -REPORT_NAME="package-dependencies" +REPORT_NAME="internal-dependencies" FULL_REPORT_DIRECTORY="${REPORTS_DIRECTORY}/${REPORT_NAME}" mkdir -p "${FULL_REPORT_DIRECTORY}" -# Execute and convert the Jupyter Notebook "PackageDependencies.ipynb" within the given reports directory -(cd "${FULL_REPORT_DIRECTORY}" && exec ${SCRIPTS_DIR}/executeJupyterNotebook.sh ${JUPYTER_NOTEBOOK_DIRECTORY}/PackageDependencies.ipynb) || exit 1 \ No newline at end of file +# Execute and convert the Jupyter Notebook "InternalDependencies.ipynb" within the given reports directory +(cd "${FULL_REPORT_DIRECTORY}" && exec ${SCRIPTS_DIR}/executeJupyterNotebook.sh ${JUPYTER_NOTEBOOK_DIRECTORY}/InternalDependencies.ipynb) || exit 1 \ No newline at end of file diff --git a/scripts/reports/OverviewCsv.sh b/scripts/reports/OverviewCsv.sh index 14c67223f..855541cc8 100755 --- a/scripts/reports/OverviewCsv.sh +++ b/scripts/reports/OverviewCsv.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash -# Executes "Package_Usage" Cypher queries to get the "package-dependencies" CSV reports. -# It contains lists of e.g. incoming and outgoing package dependencies, -# abstractness, instability and the distance to the so called "main sequence". +# Executes "Overview" Cypher queries to get the "overview-csv" CSV reports. +# It contains the numbers of packages, types, methods, cyclic complexity, etc. # Overrideable Constants (defaults also defined in sub scripts) REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"} diff --git a/scripts/reports/VisibilityMetricsJupyter.sh b/scripts/reports/VisibilityMetricsJupyter.sh index 09a5676ce..809ed3e74 100755 --- a/scripts/reports/VisibilityMetricsJupyter.sh +++ b/scripts/reports/VisibilityMetricsJupyter.sh @@ -26,5 +26,5 @@ REPORT_NAME="visibility-metrics" FULL_REPORT_DIRECTORY="${REPORTS_DIRECTORY}/${REPORT_NAME}" mkdir -p "${FULL_REPORT_DIRECTORY}" -# Execute and convert the Jupyter Notebook "PackageDependencies.ipynb" within the given reports directory +# Execute and convert the Jupyter Notebook "VisibilityMetrics.ipynb" within the given reports directory (cd "${FULL_REPORT_DIRECTORY}" && exec ${SCRIPTS_DIR}/executeJupyterNotebook.sh ${JUPYTER_NOTEBOOK_DIRECTORY}/VisibilityMetrics.ipynb) || exit 1 \ No newline at end of file