From a25944a8dd391cac0597af6a2c3c7d490c6c9585 Mon Sep 17 00:00:00 2001 From: JohT <7671054+JohT@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:24:23 +0200 Subject: [PATCH 1/2] Generate reference documentation for the whole project --- ...nternal-cypher-reference-documentation.yml | 9 +- ...ment-variables-reference-documentation.yml | 9 +- ...ternal-scripts-reference-documentation.yml | 9 +- CHANGELOG.md | 4 +- COMMANDS.md | 4 +- CYPHER.md | 511 ++++++++++++++++++ ENVIRONMENT_VARIABLES.md | 69 +++ README.md | 10 +- SCRIPTS.md | 120 ++++ cypher/CYPHER.md | 369 ------------- scripts/ENVIRONMENT_VARIABLES.md | 57 -- scripts/SCRIPTS.md | 98 ---- .../appendEnvironmentVariables.sh | 69 ++- .../documentation/generateCypherReference.sh | 20 +- .../generateEnvironmentVariableReference.sh | 32 +- .../documentation/generateScriptReference.sh | 30 +- 16 files changed, 814 insertions(+), 606 deletions(-) create mode 100644 CYPHER.md create mode 100644 ENVIRONMENT_VARIABLES.md create mode 100644 SCRIPTS.md delete mode 100644 cypher/CYPHER.md delete mode 100644 scripts/ENVIRONMENT_VARIABLES.md delete mode 100644 scripts/SCRIPTS.md diff --git a/.github/workflows/internal-cypher-reference-documentation.yml b/.github/workflows/internal-cypher-reference-documentation.yml index ea25a59cc..e286412c3 100644 --- a/.github/workflows/internal-cypher-reference-documentation.yml +++ b/.github/workflows/internal-cypher-reference-documentation.yml @@ -28,9 +28,8 @@ jobs: token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} - name: Generate cypher reference document - working-directory: cypher run: | - ./../scripts/documentation/generateCypherReference.sh + ./scripts/documentation/generateCypherReference.sh - name: Use git to detect changes in the regenerated document and set generated_document_changed run: git diff --quiet || echo "generated_document_changed=true" >> $GITHUB_ENV @@ -43,7 +42,7 @@ jobs: uses: actions/upload-artifact@v6 with: name: cypher-reference-document - path: ./cypher/CYPHER.md + path: ./CYPHER.md if-no-files-found: error retention-days: 5 @@ -57,13 +56,13 @@ jobs: git config --global user.email "7671054+JohT@users.noreply.github.com" git fetch origin git status - git add ./cypher/CYPHER.md + git add ./CYPHER.md git status git commit -m "${{ env.CI_COMMIT_MESSAGE }}" git status git rebase --strategy-option=theirs origin/main --verbose git status - git add ./cypher/CYPHER.md + git add ./CYPHER.md git status git commit --amend --no-edit git status diff --git a/.github/workflows/internal-environment-variables-reference-documentation.yml b/.github/workflows/internal-environment-variables-reference-documentation.yml index cd4639c5b..df397b855 100644 --- a/.github/workflows/internal-environment-variables-reference-documentation.yml +++ b/.github/workflows/internal-environment-variables-reference-documentation.yml @@ -28,9 +28,8 @@ jobs: token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} - name: Generate environment variables reference document - working-directory: scripts run: | - ./documentation/generateEnvironmentVariableReference.sh + ./scripts/documentation/generateEnvironmentVariableReference.sh - name: Use git to detect changes in the regenerated document and set generated_document_changed run: git diff --quiet || echo "generated_document_changed=true" >> $GITHUB_ENV @@ -43,7 +42,7 @@ jobs: uses: actions/upload-artifact@v6 with: name: environment-variables-reference-document - path: ./scripts/ENVIRONMENT_VARIABLES.md + path: ./ENVIRONMENT_VARIABLES.md if-no-files-found: error retention-days: 5 @@ -57,13 +56,13 @@ jobs: git config --global user.email "7671054+JohT@users.noreply.github.com" git fetch origin git status - git add ./scripts/ENVIRONMENT_VARIABLES.md + git add ./ENVIRONMENT_VARIABLES.md git status git commit -m "${{ env.CI_COMMIT_MESSAGE }}" git status git rebase --strategy-option=theirs origin/main --verbose git status - git add ./scripts/ENVIRONMENT_VARIABLES.md + git add ./ENVIRONMENT_VARIABLES.md git status git commit --amend --no-edit git status diff --git a/.github/workflows/internal-scripts-reference-documentation.yml b/.github/workflows/internal-scripts-reference-documentation.yml index aeee4ed15..d701eeb2e 100644 --- a/.github/workflows/internal-scripts-reference-documentation.yml +++ b/.github/workflows/internal-scripts-reference-documentation.yml @@ -28,9 +28,8 @@ jobs: token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} - name: Generate scripts reference document - working-directory: scripts run: | - ./documentation/generateScriptReference.sh + ./scripts/documentation/generateScriptReference.sh - name: Use git to detect changes in the regenerated document and set generated_document_changed run: git diff --quiet || echo "generated_document_changed=true" >> $GITHUB_ENV @@ -43,7 +42,7 @@ jobs: uses: actions/upload-artifact@v6 with: name: scripts-reference-document - path: ./scripts/SCRIPTS.md + path: ./SCRIPTS.md if-no-files-found: error retention-days: 5 @@ -57,13 +56,13 @@ jobs: git config --global user.email "7671054+JohT@users.noreply.github.com" git fetch origin git status - git add ./scripts/SCRIPTS.md + git add ./SCRIPTS.md git status git commit -m "${{ env.CI_COMMIT_MESSAGE }}" git status git rebase --strategy-option=theirs origin/main --verbose git status - git add ./scripts/SCRIPTS.md + git add ./SCRIPTS.md git status git commit --amend --no-edit git status diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eb016ec2..003889b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -511,8 +511,8 @@ For all details see: https://github.com/JohT/code-graph-analysis-pipeline/releas * Analyze static code structure, dependencies, metrics, ... * Fully automated [pipeline](./.github/workflows/public-analyze-code-graph.yml) from tool installation and artifact download to report generation -* Runtime and library independent automation using [shell scripts](./scripts/SCRIPTS.md) -* Comprehensive list of [Cypher queries](./cypher/CYPHER.md) +* Runtime and library independent automation using [shell scripts](./SCRIPTS.md) +* Comprehensive list of [Cypher queries](./CYPHER.md) * Example Analysis for [AxonFramework](https://github.com/AxonFramework/AxonFramework) ### 📖 Jupyter Notebook Reports diff --git a/COMMANDS.md b/COMMANDS.md index f5c793153..a5a9419f2 100644 --- a/COMMANDS.md +++ b/COMMANDS.md @@ -166,10 +166,10 @@ To further narrow down to only one report type within a specific domain: ### Generate Cypher Reference -Change into the [cypher](./cypher/) directory e.g. with `cd cypher` and then execute the script [generateCypherReference.sh](./scripts/documentation/generateCypherReference.sh) with the following command: +Execute the script [generateCypherReference.sh](./scripts/documentation/generateCypherReference.sh) from the root directory with the following command: ```script -./../scripts/documentation/generateCypherReference.sh +./scripts/documentation/generateCypherReference.sh ``` ### Generate Script Reference diff --git a/CYPHER.md b/CYPHER.md new file mode 100644 index 000000000..488e00d50 --- /dev/null +++ b/CYPHER.md @@ -0,0 +1,511 @@ +# Cypher Reference + +This document serves as a reference for all Cypher files in the repository and its subdirectories. +It provides a table listing each Cypher file and its corresponding description found in the first comment line. +This file was generated with the script [generateCypherReference.sh](./scripts/documentation/generateCypherReference.sh). + +Script | Directory | Description +-------|-----------|------------ +| [Artifacts_with_dependencies_to_other_artifacts.cypher](./cypher/Artifact_Dependencies/Artifacts_with_dependencies_to_other_artifacts.cypher) | Artifact_Dependencies | Artifacts with dependencies to other artifacts. Requires "Add_file_name and_extension.cypher". | +| [Artifacts_with_duplicate_packages.cypher](./cypher/Artifact_Dependencies/Artifacts_with_duplicate_packages.cypher) | Artifact_Dependencies | Artifacts with the same full qualified package name (duplicate packages). These can lead to confusion and provide access to package protected classes to another artifact that might not be intended. Requires "Add_file_name and_extension.cypher". | +| [Incoming_Java_Artifact_Dependencies.cypher](./cypher/Artifact_Dependencies/Incoming_Java_Artifact_Dependencies.cypher) | Artifact_Dependencies | Incoming Artifact Dependencies | +| [Most_used_internal_dependencies_acreoss_artifacts.cypher](./cypher/Artifact_Dependencies/Most_used_internal_dependencies_acreoss_artifacts.cypher) | Artifact_Dependencies | Most used internal dependencies across artifacts. Requires "Add_file_name and_extension.cypher". | +| [Outgoing_Java_Artifact_Dependencies.cypher](./cypher/Artifact_Dependencies/Outgoing_Java_Artifact_Dependencies.cypher) | Artifact_Dependencies | Outgoing Artifact Dependencies | +| [Set_maven_artifact_version.cypher](./cypher/Artifact_Dependencies/Set_maven_artifact_version.cypher) | Artifact_Dependencies | Set property "version" on Artifact nodes to what is specified in the Maven POM | +| [Set_number_of_Java_packages_and_types_on_artifacts.cypher](./cypher/Artifact_Dependencies/Set_number_of_Java_packages_and_types_on_artifacts.cypher) | Artifact_Dependencies | Set number of Java packages and types on artifacts | +| [Usage_and_spread_of_internal_artifact_dependencies.cypher](./cypher/Artifact_Dependencies/Usage_and_spread_of_internal_artifact_dependencies.cypher) | Artifact_Dependencies | Usage and spread of internal artifact dependencies. Requires "Add_file_name and_extension.cypher". | +| [Usage_and_spread_of_internal_artifact_dependents.cypher](./cypher/Artifact_Dependencies/Usage_and_spread_of_internal_artifact_dependents.cypher) | Artifact_Dependencies | Usage and spread of internal artifact dependents. Requires "Add_file_name and_extension.cypher". | +| [Centrality_10a_Bridges_Estimate.cypher](./cypher/Centrality/Centrality_10a_Bridges_Estimate.cypher) | Centrality | Centrality 10a Bridges Estimate | +| [Centrality_10d_Bridges_Stream.cypher](./cypher/Centrality/Centrality_10d_Bridges_Stream.cypher) | Centrality | Centrality 10d Bridges Stream | +| [Centrality_10e_Bridges_Write.cypher](./cypher/Centrality/Centrality_10e_Bridges_Write.cypher) | Centrality | Centrality 10e Bridges Stream - Write Relationship Property "isBridge" | +| [Centrality_1a_List_TopPercentile.cypher](./cypher/Centrality/Centrality_1a_List_TopPercentile.cypher) | Centrality | List the top centrality nodes with a 99.5 percentile or higher | +| [Centrality_1b_List_TopPercent.cypher](./cypher/Centrality/Centrality_1b_List_TopPercent.cypher) | Centrality | List the top 2% nodes with the highest centrality score. | +| [Centrality_1c_Label_Delete.cypher](./cypher/Centrality/Centrality_1c_Label_Delete.cypher) | Centrality | Centrality Label Delete | +| [Centrality_1d_Label_Add.cypher](./cypher/Centrality/Centrality_1d_Label_Add.cypher) | Centrality | Centrality Add label to the top 2% nodes with the highest centrality score | +| [Centrality_2a_Page_Rank_Estimate.cypher](./cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher) | Centrality | Centrality 2a Page Rank Estimate Memory | +| [Centrality_2b_Page_Rank_Statistics.cypher](./cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher) | Centrality | Centrality 2b Page Rank Statistics | +| [Centrality_3c_Page_Rank_Mutate.cypher](./cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher) | Centrality | Centrality 3c Page Rank Mutate | +| [Centrality_3d_Page_Rank_Stream.cypher](./cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher) | Centrality | Centrality 3d Page Rank Stream | +| [Centrality_3e_Page_Rank_Write.cypher](./cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher) | Centrality | Centrality 3e Page Rank Write | +| [Centrality_4a_Article_Rank_Estimate.cypher](./cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher) | Centrality | Centrality 4a Article Rank Estimate Memory | +| [Centrality_4b_Article_Rank_Statistics.cypher](./cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher) | Centrality | Centrality 4b Article Rank Statistics | +| [Centrality_4c_Article_Rank_Mutate.cypher](./cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher) | Centrality | Centrality 4c Article Rank Mutate | +| [Centrality_4d_Article_Rank_Stream.cypher](./cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher) | Centrality | Centrality 4d Article Rank Stream | +| [Centrality_4e_Article_Rank_Write.cypher](./cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher) | Centrality | Centrality 4e Article Rank Write | +| [Centrality_5a_Betweeness_Estimate.cypher](./cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher) | Centrality | Centrality 5a Betweeness Estimate | +| [Centrality_5b_Betweeness_Statistics.cypher](./cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher) | Centrality | Centrality 5b Betweeness Statistics | +| [Centrality_5c_Betweeness_Mutate.cypher](./cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher) | Centrality | Centrality 5c Betweeness Mutate | +| [Centrality_5d_Betweeness_Stream.cypher](./cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher) | Centrality | Centrality 5d Betweeness Stream | +| [Centrality_5e_Betweeness_Write.cypher](./cypher/Centrality/Centrality_5e_Betweeness_Write.cypher) | Centrality | Centrality 5e Betweeness Write | +| [Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher](./cypher/Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher) | Centrality | Centrality 6a Cost-effective Lazy Forward (CELF) Estimate | +| [Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher](./cypher/Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher) | Centrality | Centrality 6b Cost-effective Lazy Forward (CELF) Statistics | +| [Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher](./cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher) | Centrality | Centrality 6c Cost-effective Lazy Forward (CELF) Mutate | +| [Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher](./cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher) | Centrality | Centrality 6d Cost-effective Lazy Forward (CELF) Stream | +| [Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher](./cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher) | Centrality | Centrality 6e Cost-effective Lazy Forward (CELF) Write | +| [Centrality_7b_Harmonic_Closeness_Statistics.cypher](./cypher/Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher) | Centrality | Centrality 7b Harmonic Closeness Statistics | +| [Centrality_7c_Harmonic_Closeness_Mutate.cypher](./cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher) | Centrality | Centrality 7c Harmonic Closeness Mutate | +| [Centrality_7d_Harmonic_Closeness_Stream.cypher](./cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher) | Centrality | Centrality 7a Harmonic Closeness Stream | +| [Centrality_7e_Harmonic_Closeness_Write.cypher](./cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher) | Centrality | Centrality 7d Harmonic Closeness Write | +| [Centrality_8b_Closeness_Statistics.cypher](./cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher) | Centrality | Centrality 8b Closeness Statistics | +| [Centrality_8c_Closeness_Mutate.cypher](./cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher) | Centrality | Centrality 8c Closeness Mutate | +| [Centrality_8d_Closeness_Stream.cypher](./cypher/Centrality/Centrality_8d_Closeness_Stream.cypher) | Centrality | Centrality 8c Closeness Stream | +| [Centrality_8e_Closeness_Write.cypher](./cypher/Centrality/Centrality_8e_Closeness_Write.cypher) | Centrality | Centrality 8d Closeness Write | +| [Centrality_90_Summary.cypher](./cypher/Centrality/Centrality_90_Summary.cypher) | Centrality | Centrality Summary. Requires "Add_file_name and_extension.cypher". | +| [Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher](./cypher/Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher) | Centrality | Centrality 9a Hyperlink-Induced Topic Search (HITS) Memory Estimation | +| [Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher](./cypher/Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher) | Centrality | Centrality 9b Hyperlink-Induced Topic Search (HITS) Statistics | +| [Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher](./cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher) | Centrality | Centrality 9c Hyperlink-Induced Topic Search (HITS) Mutate | +| [Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher](./cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher) | Centrality | Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream Mutated. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | +| [Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher](./cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher) | Centrality | Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream | +| [Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher](./cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher) | Centrality | Centrality 9e Hyperlink-Induced Topic Search (HITS) Write | +| [Set_Parameters.cypher](./cypher/Centrality/Set_Parameters.cypher) | Centrality | Example on how to set the parameters for centrality in this case for Packages and PageRank | +| [Community_Detection_10a_LocalClusteringCoefficient_Estimate.cypher](./cypher/Community_Detection/Community_Detection_10a_LocalClusteringCoefficient_Estimate.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Estimate | +| [Community_Detection_10b_LocalClusteringCoefficient_Statistics.cypher](./cypher/Community_Detection/Community_Detection_10b_LocalClusteringCoefficient_Statistics.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Statistics | +| [Community_Detection_10c_LocalClusteringCoefficient_Mutate.cypher](./cypher/Community_Detection/Community_Detection_10c_LocalClusteringCoefficient_Mutate.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Mutate | +| [Community_Detection_10d_LocalClusteringCoefficient_Stream_Aggregated.cypher](./cypher/Community_Detection/Community_Detection_10d_LocalClusteringCoefficient_Stream_Aggregated.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Stream Aggregated | +| [Community_Detection_10d_LocalClusteringCoefficient_Stream.cypher](./cypher/Community_Detection/Community_Detection_10d_LocalClusteringCoefficient_Stream.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Stream | +| [Community_Detection_10e_LocalClusteringCoefficient_Write.cypher](./cypher/Community_Detection/Community_Detection_10e_LocalClusteringCoefficient_Write.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Write | +| [Community_Detection_11a_HDBSCAN_Estimate.cypher](./cypher/Community_Detection/Community_Detection_11a_HDBSCAN_Estimate.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Estimate | +| [Community_Detection_11b_HDBSCAN_Statistics.cypher](./cypher/Community_Detection/Community_Detection_11b_HDBSCAN_Statistics.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Statistics | +| [Community_Detection_11c_HDBSCAN_Mutate.cypher](./cypher/Community_Detection/Community_Detection_11c_HDBSCAN_Mutate.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Mutate | +| [Community_Detection_11d_HDBSCAN_Stream.cypher](./cypher/Community_Detection/Community_Detection_11d_HDBSCAN_Stream.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Stream | +| [Community_Detection_11e_HDBSCAN_Write.cypher](./cypher/Community_Detection/Community_Detection_11e_HDBSCAN_Write.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - write node property e.g. communityHdbscanLabel | +| [Community_Detection_1a_Louvain_Estimate.cypher](./cypher/Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher) | Community_Detection | Community Detection Louvain Estimate Memory | +| [Community_Detection_1b_Louvain_Statistics.cypher](./cypher/Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher) | Community_Detection | Community Detection Louvain Statistics | +| [Community_Detection_1c_Louvain_Mutate.cypher](./cypher/Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher) | Community_Detection | Community Detection Louvain Mutate | +| [Community_Detection_1d_Louvain_Stream.cypher](./cypher/Community_Detection/Community_Detection_1d_Louvain_Stream.cypher) | Community_Detection | Community Detection Louvain Stream | +| [Community_Detection_1d_Stream_Intermediate_Mutated.cypher](./cypher/Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher) | Community_Detection | Community Detection Stream Intermediate Mutated for hierarchical algorithmns (Louvain, Leiden) | +| [Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher](./cypher/Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher) | Community_Detection | Community Detection Louvain Write communityLouvainIntermediateIds | +| [Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher](./cypher/Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher) | Community_Detection | Community Detection Louvain write node property communityLouvainId | +| [Community_Detection_2a_Leiden_Estimate.cypher](./cypher/Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher) | Community_Detection | Community Detection Leiden Estimate Memory | +| [Community_Detection_2b_Leiden_Statistics.cypher](./cypher/Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher) | Community_Detection | Community Detection Leiden Statistics | +| [Community_Detection_2b_Leiden_Tuneable_Statistics.cypher](./cypher/Community_Detection/Community_Detection_2b_Leiden_Tuneable_Statistics.cypher) | Community_Detection | Community Detection Leiden Statistics | +| [Community_Detection_2c_Leiden_Mutate.cypher](./cypher/Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher) | Community_Detection | Community Detection Leiden Mutate | +| [Community_Detection_2d_Leiden_Stream.cypher](./cypher/Community_Detection/Community_Detection_2d_Leiden_Stream.cypher) | Community_Detection | Community Detection Leiden Stream | +| [Community_Detection_2d_Leiden_Tuneable_Write.cypher](./cypher/Community_Detection/Community_Detection_2d_Leiden_Tuneable_Write.cypher) | Community_Detection | Community Detection Leiden Write property communityLeidenId | +| [Community_Detection_2d_Leiden_Write_Node_Property.cypher](./cypher/Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher) | Community_Detection | Community Detection Leiden Write property communityLeidenId | +| [Community_Detection_3a_StronglyConnectedComponents_Estimate.cypher](./cypher/Community_Detection/Community_Detection_3a_StronglyConnectedComponents_Estimate.cypher) | Community_Detection | Community Detection Strongly Connected Components Estimate | +| [Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher](./cypher/Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher) | Community_Detection | Community Detection Weakly Connected Components | +| [Community_Detection_3b_StronglyConnectedComponents_Statistics.cypher](./cypher/Community_Detection/Community_Detection_3b_StronglyConnectedComponents_Statistics.cypher) | Community_Detection | Community Detection Strongly Connected Components Statistics | +| [Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher](./cypher/Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher) | Community_Detection | Community Detection Weakly Connected Components Statistics | +| [Community_Detection_3c_StronglyConnectedComponents_Mutate.cypher](./cypher/Community_Detection/Community_Detection_3c_StronglyConnectedComponents_Mutate.cypher) | Community_Detection | Community Detection Strongly Connected Components Mutate | +| [Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher](./cypher/Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher) | Community_Detection | Community Detection Weakly Connected Components Mutate | +| [Community_Detection_3d_StrongyConnectedComponents_Stream.cypher](./cypher/Community_Detection/Community_Detection_3d_StrongyConnectedComponents_Stream.cypher) | Community_Detection | Community Detection Strongly Connected Components Stream | +| [Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher](./cypher/Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher) | Community_Detection | Community Detection Weakly Connected Components Stream | +| [Community_Detection_3e_StronglyConnectedComponents_Write.cypher](./cypher/Community_Detection/Community_Detection_3e_StronglyConnectedComponents_Write.cypher) | Community_Detection | Community Detection Strongly Connected Components write node property communityStronglyConnectedComponentId | +| [Community_Detection_3e_WeaklyConnectedComponents_Write.cypher](./cypher/Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher) | Community_Detection | Community Detection Weakly Connected Components write node property communityWeaklyConnectedComponentId | +| [Community_Detection_4a_Label_Propagation_Estimate.cypher](./cypher/Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher) | Community_Detection | Community Detection Label Propagation Estimate | +| [Community_Detection_4b_Label_Propagation_Statistics.cypher](./cypher/Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher) | Community_Detection | Community Detection Label Propagation Statistics | +| [Community_Detection_4c_Label_Propagation_Mutate.cypher](./cypher/Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher) | Community_Detection | Community Detection Label Propagation Mutate | +| [Community_Detection_4d_Label_Propagation_Stream.cypher](./cypher/Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher) | Community_Detection | Community Detection Label Propagation Stream | +| [Community_Detection_4e_Label_Propagation_Write.cypher](./cypher/Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher) | Community_Detection | Community Detection Label Propagation write node property communityLabelPropagationId | +| [Community_Detection_5a_K_Core_Decomposition_Estimate.cypher](./cypher/Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher) | Community_Detection | Community Detection K-Core Decomposition Estimate | +| [Community_Detection_5b_K_Core_Decomposition_Statistics.cypher](./cypher/Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher) | Community_Detection | Community Detection K-Core Decomposition Statistics | +| [Community_Detection_5c_K_Core_Decomposition_Mutate.cypher](./cypher/Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher) | Community_Detection | Community Detection K-Core Decomposition Mutate | +| [Community_Detection_5d_K_Core_Decomposition_Stream.cypher](./cypher/Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher) | Community_Detection | Community Detection K-Core Decomposition Stream | +| [Community_Detection_5e_K_Core_Decomposition_Write.cypher](./cypher/Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher) | Community_Detection | Community Detection K-Core Decomposition write node property communitykCoreDecompositionValue | +| [Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher](./cypher/Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Estimate | +| [Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher](./cypher/Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Mutate | +| [Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher](./cypher/Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Stream | +| [Community_Detection_7d_Modularity_Members.cypher](./cypher/Community_Detection/Community_Detection_7d_Modularity_Members.cypher) | Community_Detection | Community Detection Modularity Members. Requires "Add_file_name and_extension.cypher". | +| [Community_Detection_7d_Modularity.cypher](./cypher/Community_Detection/Community_Detection_7d_Modularity.cypher) | Community_Detection | Community Detection Modularity | +| [Community_Detection_7e_Write_Modularity.cypher](./cypher/Community_Detection/Community_Detection_7e_Write_Modularity.cypher) | Community_Detection | Community Detection Modularity Write | +| [Community_Detection_8d_Conductance_Members.cypher](./cypher/Community_Detection/Community_Detection_8d_Conductance_Members.cypher) | Community_Detection | Community Detection Conductance Members. Requires "Add_file_name and_extension.cypher". | +| [Community_Detection_8d_Conductance.cypher](./cypher/Community_Detection/Community_Detection_8d_Conductance.cypher) | Community_Detection | Community Detection Conductance | +| [Community_Detection_9_Community_Metrics.cypher](./cypher/Community_Detection/Community_Detection_9_Community_Metrics.cypher) | Community_Detection | Community Metrics. Requires "Add_file_name and_extension.cypher". | +| [Community_Detection_Summary.cypher](./cypher/Community_Detection/Community_Detection_Summary.cypher) | Community_Detection | Community Detection Summary. Variables: dependencies_projection_node ("Artifact", "Package", "Type"). Requires "Add_file_name and_extension.cypher". | +| [Compare_Louvain_vs_Leiden_Results.cypher](./cypher/Community_Detection/Compare_Louvain_vs_Leiden_Results.cypher) | Community_Detection | Compare Louvain vs. Leiden Community Detection Results. Variables: dependencies_projection_node (e.g. "Artifact", "Package", "Type"). Requires "Add_file_name and_extension.cypher". | +| [Get_all_Packages_with_a_Community_Detection_Label.cypher](./cypher/Community_Detection/Get_all_Packages_with_a_Community_Detection_Label.cypher) | Community_Detection | Get all Packages with a Community Detection Label | +| [Set_Parameters.cypher](./cypher/Community_Detection/Set_Parameters.cypher) | Community_Detection | Example on how to set the parameters for community detaction in this case for Packages and Leiden | +| [Type_communities_that_span_the_most_packages_with_type_statistics.cypher](./cypher/Community_Detection/Type_communities_that_span_the_most_packages_with_type_statistics.cypher) | Community_Detection | Communities that span the most packages with type statistics | +| [Type_communities_that_span_the_most_packages.cypher](./cypher/Community_Detection/Type_communities_that_span_the_most_packages.cypher) | Community_Detection | Communities that span the most packages. Requires "Add_file_name and_extension.cypher". | +| [Type_communities_with_few_members_in_foreign_packages.cypher](./cypher/Community_Detection/Type_communities_with_few_members_in_foreign_packages.cypher) | Community_Detection | Type communities with few members in foreign packages. Requires "Add_file_name and_extension.cypher". | +| [Which_package_community_spans_multiple_artifacts.cypher](./cypher/Community_Detection/Which_package_community_spans_multiple_artifacts.cypher) | Community_Detection | Which package community spans multiple artifacts? Requires "Add_file_name and_extension.cypher". | +| [Which_package_community_spans_several_artifacts_and_how_are_the_packages_distributed.cypher](./cypher/Community_Detection/Which_package_community_spans_several_artifacts_and_how_are_the_packages_distributed.cypher) | Community_Detection | Which package community spans several artifacts and how are the packages distributed? Requires "Add_file_name and_extension.cypher". | +| [Which_type_community_spans_several_artifacts_and_how_are_the_types_distributed.cypher](./cypher/Community_Detection/Which_type_community_spans_several_artifacts_and_how_are_the_types_distributed.cypher) | Community_Detection | Which type community spans several artifacts and how are the types distributed? Requires "Add_file_name and_extension.cypher". | +| [Count_nodes_and_relationships.cypher](./cypher/Count_nodes_and_relationships.cypher) | cypher | Count nodes and relationships | +| [Create_Java_Type_index_for_full_qualified_name.cypher](./cypher/Create_Java_Type_index_for_full_qualified_name.cypher) | cypher | Create index for the full qualified type name | +| [Create_Typescript_index_for_full_qualified_name.cypher](./cypher/Create_Typescript_index_for_full_qualified_name.cypher) | cypher | Create index for the full qualified type name | +| [Create_Typescript_index_for_name.cypher](./cypher/Create_Typescript_index_for_name.cypher) | cypher | Create index for the name for Typescript nodes | +| [Data_verification_DEPENDS_ON_relationships.cypher](./cypher/Data_verification_DEPENDS_ON_relationships.cypher) | cypher | Data verification DEPENDS_ON relationship distinct label constellations | +| [Dependencies_0_Check_Projectable.cypher](./cypher/Dependencies_Projection/Dependencies_0_Check_Projectable.cypher) | Dependencies_Projection | Check if there is at least one projectable dependency. Variables: dependencies_projection_node, dependencies_projection_weight_property | +| [Dependencies_0_Check_Projection_Exists.cypher](./cypher/Dependencies_Projection/Dependencies_0_Check_Projection_Exists.cypher) | Dependencies_Projection | Check if the projection exists. Variables: dependencies_projection | +| [Dependencies_0_Prepare_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_0_Prepare_Projection.cypher) | Dependencies_Projection | Prepare projection by e.g. filling in default values for missing properties | +| [Dependencies_0_Verify_Projectable.cypher](./cypher/Dependencies_Projection/Dependencies_0_Verify_Projectable.cypher) | Dependencies_Projection | Verify that nodes and relationships are complete and ready for projection | +| [Dependencies_1_Delete_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_1_Delete_Projection.cypher) | Dependencies_Projection | Delete projection if existing. Variables: dependencies_projection | +| [Dependencies_10_Delete_Label.cypher](./cypher/Dependencies_Projection/Dependencies_10_Delete_Label.cypher) | Dependencies_Projection | Community Detection Label Propagation Label Delete | +| [Dependencies_11_Add_Label.cypher](./cypher/Dependencies_Projection/Dependencies_11_Add_Label.cypher) | Dependencies_Projection | Write a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | +| [Dependencies_12_Get_Projection_Statistics.cypher](./cypher/Dependencies_Projection/Dependencies_12_Get_Projection_Statistics.cypher) | Dependencies_Projection | Get dependency projection statistics | +| [Dependencies_13_Sample_Projected_Graph.cypher](./cypher/Dependencies_Projection/Dependencies_13_Sample_Projected_Graph.cypher) | Dependencies_Projection | Creates a smaller projection by sampling the original graph using "Common Neighbour Aware Random Walk" | +| [Dependencies_14_Write_Batch_Data.cypher](./cypher/Dependencies_Projection/Dependencies_14_Write_Batch_Data.cypher) | Dependencies_Projection | Writes batch data back into the database for code units when working with a dependencies projection. Variables: dependencies_projection_rows, dependencies_projection_node | +| [Dependencies_2_Delete_Subgraph.cypher](./cypher/Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher) | Dependencies_Projection | Delete filtered subgraph projection if exists. Variables: dependencies_projection | +| [Dependencies_3_Create_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_3_Create_Projection.cypher) | Dependencies_Projection | Create directed projection. Variables: dependencies_projection, dependencies_projection_node, dependencies_projection_weight_property | +| [Dependencies_3b_Create_Multi_Relationship_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_3b_Create_Multi_Relationship_Projection.cypher) | Dependencies_Projection | Create multi relationship projection. Variables: dependencies_projection, dependencies_projection_node | +| [Dependencies_3c_Create_Java_Type_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_3c_Create_Java_Type_Projection.cypher) | Dependencies_Projection | Create filtered Java Type node projection without zero-degree nodes, external types, java types or duplicates. Variables: dependencies_projection. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | +| [Dependencies_3d_Create_Java_Method_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_3d_Create_Java_Method_Projection.cypher) | Dependencies_Projection | Create directed projection for public Java methods filtering out constructors, getters and setters. Variables: dependencies_projection, dependencies_projection_weight_property | +| [Dependencies_4_Create_Undirected_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_4_Create_Undirected_Projection.cypher) | Dependencies_Projection | Create undirected projection. Variables: dependencies_projection, dependencies_projection_node, dependencies_projection_weight_property | +| [Dependencies_4c_Create_Undirected_Java_Type_Projection.cypher](./cypher/Dependencies_Projection/Dependencies_4c_Create_Undirected_Java_Type_Projection.cypher) | Dependencies_Projection | Create filtered Java Type node projection without zero-degree nodes, external types, java types or duplicates. Variables: dependencies_projection. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | +| [Dependencies_5_Create_Subgraph.cypher](./cypher/Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher) | Dependencies_Projection | Create filtered subgraph projection without zero-degree nodes. Variables: dependencies_projection, dependencies_projection_node | +| [Dependencies_6_Check_Projection_Nodes.cypher](./cypher/Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher) | Dependencies_Projection | Check Projection Node Properties | +| [Dependencies_7_Check_Projection_Relationships.cypher](./cypher/Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher) | Dependencies_Projection | Check Projection Relationships | +| [Dependencies_8_Stream_Mutated_Extended.cypher](./cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher) | Dependencies_Projection | Read a property from projected nodes extended by some details. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | +| [Dependencies_8_Stream_Mutated_Grouped.cypher](./cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher) | Dependencies_Projection | Read a property from projected nodes. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | +| [Dependencies_8_Stream_Mutated_Value_Descending.cypher](./cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher) | Dependencies_Projection | Read a property from projected nodes ordered by their value descending. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | +| [Dependencies_8_Stream_Mutated.cypher](./cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher) | Dependencies_Projection | Read a property from projected nodes unordered. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | +| [Dependencies_9_Write_Mutated.cypher](./cypher/Dependencies_Projection/Dependencies_9_Write_Mutated.cypher) | Dependencies_Projection | Write a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | +| [Set_Parameters.cypher](./cypher/Dependencies_Projection/Set_Parameters.cypher) | Dependencies_Projection | Example on how to set the parameters for the dependencies projection in this case for Packages and the useage with PageRank | +| [Add_fine_grained_weights_for_Typescript_external_module_dependencies.cypher](./cypher/DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_external_module_dependencies.cypher) | DependsOn_Relationship_Weights | Add fine grained weight properties for dependencies between Typescript modules | +| [Add_fine_grained_weights_for_Typescript_internal_module_dependencies.cypher](./cypher/DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_internal_module_dependencies.cypher) | DependsOn_Relationship_Weights | Add fine grained weight properties for dependencies between internal Typescript modules | +| [Add_weight_property_for_Java_Interface_Dependencies_to_Package_DEPENDS_ON_Relationship.cypher](./cypher/DependsOn_Relationship_Weights/Add_weight_property_for_Java_Interface_Dependencies_to_Package_DEPENDS_ON_Relationship.cypher) | DependsOn_Relationship_Weights | Add weight property for Interface Dependencies to Package DEPENDS_ON Relationship | +| [Add_weight_property_to_Java_Package_DEPENDS_ON_Relationship.cypher](./cypher/DependsOn_Relationship_Weights/Add_weight_property_to_Java_Package_DEPENDS_ON_Relationship.cypher) | DependsOn_Relationship_Weights | Add weight property to Package DEPENDS_ON Relationship | +| [Add_weight10PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher](./cypher/DependsOn_Relationship_Weights/Add_weight10PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher) | DependsOn_Relationship_Weights | Add weight10PercentInterfaces to Package DEPENDS_ON relationships | +| [Add_weight25PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher](./cypher/DependsOn_Relationship_Weights/Add_weight25PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher) | DependsOn_Relationship_Weights | Add weight25PercentInterfaces to Package DEPENDS_ON relationships | +| [Explore_common_globalfqn_prefix.cypher](./cypher/Exploration/Explore_common_globalfqn_prefix.cypher) | Exploration | Get common global full qualified name prefix | +| [Explore_degree_schema.cypher](./cypher/Exploration/Explore_degree_schema.cypher) | Exploration | Explore incoming/outgoing relationship (degree) schema | +| [Explore_DEPENDS_ON_relationships.cypher](./cypher/Exploration/Explore_DEPENDS_ON_relationships.cypher) | Exploration | Explore DEPENDS_ON relationships schema | +| [Explore_external_Typescript_dependencies.cypher](./cypher/Exploration/Explore_external_Typescript_dependencies.cypher) | Exploration | Explore Typescript nodes with globalFqn property by their label, count and if they came from the node_modules folder | +| [Explore_ExternalDeclaration.cypher](./cypher/Exploration/Explore_ExternalDeclaration.cypher) | Exploration | External declarations split by their module and their contained symbols | +| [Explore_Module_outgoing_dependencies.cypher](./cypher/Exploration/Explore_Module_outgoing_dependencies.cypher) | Exploration | Explore outgoing dependencies of modules | +| [Explore_node_properties_non_null.cypher](./cypher/Exploration/Explore_node_properties_non_null.cypher) | Exploration | Explore non null node property counts for the selected node label. Variables: projection_node_label | +| [Explore_node_properties.cypher](./cypher/Exploration/Explore_node_properties.cypher) | Exploration | Explore node properties, the labels of their nodes and their count | +| [Explore_node_relationships.cypher](./cypher/Exploration/Explore_node_relationships.cypher) | Exploration | Get all relationships of one specific node to explore the schema | +| [Explore_schema.cypher](./cypher/Exploration/Explore_schema.cypher) | Exploration | Explore node labels and their relationships for a schema overview | +| [Explore_Typescript_elements_with_same_globalFqn.cypher](./cypher/Exploration/Explore_Typescript_elements_with_same_globalFqn.cypher) | Exploration | Explore Typescript elements with same globalFqn | +| [Explore_Typescript_modules_overview.cypher](./cypher/Exploration/Explore_Typescript_modules_overview.cypher) | Exploration | Explore nodes grouped by their module (first part of globalFqn) | +| [Explore_Typescript_modules_per_symboltype.cypher](./cypher/Exploration/Explore_Typescript_modules_per_symboltype.cypher) | Exploration | Explore nodes grouped by their module (first part of globalFqn) and their type of contained symbols | +| [Explore_Typescript_projects.cypher](./cypher/Exploration/Explore_Typescript_projects.cypher) | Exploration | Explore Typescript Projects | +| [Export_the_whole_database_as_CSV.cypher](./cypher/Export_the_whole_database_as_CSV.cypher) | cypher | Export the whole database as CSV | +| [Add_file_name and_extension.cypher](./cypher/General_Enrichment/Add_file_name and_extension.cypher) | General_Enrichment | | +| [Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher](./cypher/GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher) | GitLog | Take the already existing "CHANGED_TOGETHER_WITH" relationship between git files and apply it to resolved file nodes. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | +| [Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher](./cypher/GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher) | GitLog | Connect git files that where changed together frequently with "CHANGED_TOGETHER_WITH" | +| [Add_HAS_PARENT_relationships_to_commits.cypher](./cypher/GitLog/Add_HAS_PARENT_relationships_to_commits.cypher) | GitLog | Creates a HAS_PARENT relationship between Git Commit nodes and their parent. | +| [Add_RESOLVES_TO_relationships_to_git_files_for_Java.cypher](./cypher/GitLog/Add_RESOLVES_TO_relationships_to_git_files_for_Java.cypher) | GitLog | Connect git files to Java code files with a RESOLVES_TO relationship if their names match Note: Its quite tricky to match Java class file paths from inside e.g. *.jar files to their source repository file path reliable. This could be improved by utilizing package manager data (like maven). Even that turns out to be not easy, since the folder structure can be customized. Therefore, this is only a simplified attempt and by no means complete. Note: Even if is tempting to combine this file with the Typescript variant, they are intentionally separated. The differences are subtle but need to be thought through and tested carefully. Having separate files makes it obvious that there needs to be one for every new source code language. | +| [Add_RESOLVES_TO_relationships_to_git_files_for_Typescript.cypher](./cypher/GitLog/Add_RESOLVES_TO_relationships_to_git_files_for_Typescript.cypher) | GitLog | Connect git files to Typescript files with a RESOLVES_TO relationship if their names match Note: Even if is tempting to combine this file with the Java variant, they are intentionally separated. The differences are subtle but need to be thought through and tested carefully. Having separate files makes it obvious that there needs to be one for every new source code language. | +| [Create_git_repository_node.cypher](./cypher/GitLog/Create_git_repository_node.cypher) | GitLog | Create git repository information node | +| [Delete_git_log_data.cypher](./cypher/GitLog/Delete_git_log_data.cypher) | GitLog | Delete all Git log data in the Graph | +| [Delete_plain_git_directory_file_nodes.cypher](./cypher/GitLog/Delete_plain_git_directory_file_nodes.cypher) | GitLog | Delete plain file nodes in "/.git" directory | +| [Import_aggregated_git_log_csv_data.cypher](./cypher/GitLog/Import_aggregated_git_log_csv_data.cypher) | GitLog | Import aggregated git log CSV data with the following schema: (Git:Log:Author)-[:AUTHORED]->(Git:Log:ChangeSpan)-[:CONTAINS]->(Git:Log:File) , (Git:Repository)-[:HAS_CHANGE_SPAN]->(Git:Log:ChangeSpan) , (Git:Repository)-[:HAS_AUTHER]->(Git:Log:Auther) , (Git:Repository)-[:HAS_FILE]->(Git:Log:File). Variables: git_repository_absolute_directory_name | +| [Import_git_log_csv_data.cypher](./cypher/GitLog/Import_git_log_csv_data.cypher) | GitLog | Import git log CSV data with the following schema: (Git:Log:Author)-[:AUTHORED]->(Git:Log:Commit)-[:CONTAINS]->(Git:Log:File) , (Git:Repository)-[:HAS_HAS_COMMIT]->(Git:Log:Commit) , (Git:Repository)-[:HAS_HAS_AUTHOR]->(Git:Log:Author) , (Git:Repository)-[:HAS_HAS_FILE]->(Git:Log:File). Variables: git_repository_absolute_directory_name | +| [Index_absolute_file_name.cypher](./cypher/GitLog/Index_absolute_file_name.cypher) | GitLog | Create index for the absolute file name | +| [Index_author_name.cypher](./cypher/GitLog/Index_author_name.cypher) | GitLog | Create index for author name (git data) | +| [Index_change_span_year.cypher](./cypher/GitLog/Index_change_span_year.cypher) | GitLog | Create index for change span year (aggregated git data) | +| [Index_commit_hash.cypher](./cypher/GitLog/Index_commit_hash.cypher) | GitLog | Create index for commit hash (git data) | +| [Index_commit_parent.cypher](./cypher/GitLog/Index_commit_parent.cypher) | GitLog | Create index for parent commit hash (git data) | +| [Index_commit_sha.cypher](./cypher/GitLog/Index_commit_sha.cypher) | GitLog | Create index for git commit sha | +| [Index_file_name.cypher](./cypher/GitLog/Index_file_name.cypher) | GitLog | Create index for the file name | +| [Index_file_relative_path.cypher](./cypher/GitLog/Index_file_relative_path.cypher) | GitLog | Create index for the relative file path | +| [List_ambiguous_git_files.cypher](./cypher/GitLog/List_ambiguous_git_files.cypher) | GitLog | List ambigiously resolved git files where a single git file is attached to more than one code file for troubleshooting/testing. | +| [List_git_file_directories_with_commit_statistics.cypher](./cypher/GitLog/List_git_file_directories_with_commit_statistics.cypher) | GitLog | List git file directories and their statistics | +| [List_git_files_by_resolved_label_and_extension.cypher](./cypher/GitLog/List_git_files_by_resolved_label_and_extension.cypher) | GitLog | List resolved and unresolved git files by their extension | +| [List_git_files_per_commit_distribution.cypher](./cypher/GitLog/List_git_files_per_commit_distribution.cypher) | GitLog | List how many git commits changed one file, how mandy changed two files, .... | +| [List_git_files_that_were_changed_together_all_in_one.cypher](./cypher/GitLog/List_git_files_that_were_changed_together_all_in_one.cypher) | GitLog | List git files that where changed together frequently | +| [List_git_files_that_were_changed_together_with_another_file_all_in_one.cypher](./cypher/GitLog/List_git_files_that_were_changed_together_with_another_file_all_in_one.cypher) | GitLog | List git files that where changed together frequently | +| [List_git_files_that_were_changed_together_with_another_file.cypher](./cypher/GitLog/List_git_files_that_were_changed_together_with_another_file.cypher) | GitLog | List git files that where frequently changed with another file. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | +| [List_git_files_that_were_changed_together.cypher](./cypher/GitLog/List_git_files_that_were_changed_together.cypher) | GitLog | List git files that where changed together frequently. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | +| [List_git_files_with_commit_statistics_by_author.cypher](./cypher/GitLog/List_git_files_with_commit_statistics_by_author.cypher) | GitLog | List git files with commit statistics | +| [List_pairwise_changed_files_top_selected_metric.cypher](./cypher/GitLog/List_pairwise_changed_files_top_selected_metric.cypher) | GitLog | Get the top 4 file extensions that where changed together most often and list top 20 pair that were changed together for each of the top file extension pair by their highest commit lift (>1: changes more often than by random chance). Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first. | +| [List_pairwise_changed_files_with_dependencies.cypher](./cypher/GitLog/List_pairwise_changed_files_with_dependencies.cypher) | GitLog | List pair of files that were changed together and that have a declared dependency between each other. Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher and Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher to run first. | +| [List_pairwise_changed_files.cypher](./cypher/GitLog/List_pairwise_changed_files.cypher) | GitLog | List pairs of files that were changed together. Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first. | +| [List_unresolved_git_files.cypher](./cypher/GitLog/List_unresolved_git_files.cypher) | GitLog | List code files not covered by imported git data for troubleshooting/testing. | +| [Set_commit_classification_properties.cypher](./cypher/GitLog/Set_commit_classification_properties.cypher) | GitLog | Classify git commits and set properties like isMergeCommit, isAutomationCommit (=isBotCommit or isMavenCommit). | +| [Set_number_of_aggregated_git_commits.cypher](./cypher/GitLog/Set_number_of_aggregated_git_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when aggregated change spans with grouped commits are present. | +| [Set_number_of_git_log_commits.cypher](./cypher/GitLog/Set_number_of_git_log_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when git commits are present | +| [Set_number_of_git_plugin_commits.cypher](./cypher/GitLog/Set_number_of_git_plugin_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when git commits (detected by the plugin) are present | +| [Set_number_of_git_plugin_update_commits.cypher](./cypher/GitLog/Set_number_of_git_plugin_update_commits.cypher) | GitLog | Set updateCommitCount property on Git File nodes when git commits with Update modifier (detected by the plugin) are present | +| [Verify_code_to_git_file_unambiguous.cypher](./cypher/GitLog/Verify_code_to_git_file_unambiguous.cypher) | GitLog | Verify that code to git file relationships aren't ambiguous | +| [Verify_git_missing_CHANGED_TOGETHER_WITH_properties.cypher](./cypher/GitLog/Verify_git_missing_CHANGED_TOGETHER_WITH_properties.cypher) | GitLog | Verify if CHANGED_TOGETHER_WITH properties from git are missing | +| [Verify_git_missing_create_date.cypher](./cypher/GitLog/Verify_git_missing_create_date.cypher) | GitLog | Verify that git to code file relationships aren't ambiguous | +| [Verify_git_to_code_file_unambiguous.cypher](./cypher/GitLog/Verify_git_to_code_file_unambiguous.cypher) | GitLog | Verify that git to code file relationships aren't ambiguous | +| [Annotated_code_elements_per_artifact.cypher](./cypher/Java/Annotated_code_elements_per_artifact.cypher) | Java | Annotated code elements per artifact and element type with some examples. Requires "Add_file_name and_extension.cypher". | +| [Annotated_code_elements.cypher](./cypher/Java/Annotated_code_elements.cypher) | Java | Annotated code elements overall by element type with some examples | +| [Get_all_declared_and_inherited_methods_of_a_type.cypher](./cypher/Java/Get_all_declared_and_inherited_methods_of_a_type.cypher) | Java | Get all declared and inherited methods of a type | +| [JakartaEE_REST_Annotations_Nodes.cypher](./cypher/Java/JakartaEE_REST_Annotations_Nodes.cypher) | Java | Jakarta Enterprise Edition JAX-RS REST Annotations Nodes --- Method Http Annotation --- | +| [JakartaEE_REST_Annotations.cypher](./cypher/Java/JakartaEE_REST_Annotations.cypher) | Java | Jakarta Enterprise Edition JAX-RS REST Annotations. Requires "Add_file_name and_extension.cypher". --- Method Http Annotation --- | +| [Java_deprecated_element_usage_detailed.cypher](./cypher/Java/Java_deprecated_element_usage_detailed.cypher) | Java | List all non deprecated elements (types, members) that call deprecated elements. Requires "Add_file_name and_extension.cypher". | +| [Java_deprecated_element_usage.cypher](./cypher/Java/Java_deprecated_element_usage.cypher) | Java | Query deprecated type and member usage by non deprecated elements. Requires "Add_file_name and_extension.cypher". | +| [Java_Reflection_usage_detailed.cypher](./cypher/Java/Java_Reflection_usage_detailed.cypher) | Java | Query all types that use Java Reflection or "Class.forName". Requires "Add_file_name and_extension.cypher". | +| [Java_Reflection_usage.cypher](./cypher/Java/Java_Reflection_usage.cypher) | Java | Query Java Reflection usage combined with invocations of "Class.forName". Requires "Add_file_name and_extension.cypher". | +| [Label_external_types_and_annotations.cypher](./cypher/Java/Label_external_types_and_annotations.cypher) | Java | Label external types and external annotations. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | +| [Remove_external_type_and_annotation_labels.cypher](./cypher/Java/Remove_external_type_and_annotation_labels.cypher) | Java | Remove external type and annotation labels | +| [Spring_Web_Request_Annotations.cypher](./cypher/Java/Spring_Web_Request_Annotations.cypher) | Java | Spring Web Request Annotations. Requires "Add_file_name and_extension.cypher". --- Method HTTP Annotation --- | +| [Calculate_and_set_Abstractness_for_Java_including_Subpackages.cypher](./cypher/Metrics/Calculate_and_set_Abstractness_for_Java_including_Subpackages.cypher) | Metrics | Calculate and set Abstractness for Java Packages including sub-packages. Requires "Add_file_name and_extension.cypher". | +| [Calculate_and_set_Abstractness_for_Java.cypher](./cypher/Metrics/Calculate_and_set_Abstractness_for_Java.cypher) | Metrics | Calculate and set Abstractness for Java Packages including Counts. Requires "Add_file_name and_extension.cypher". | +| [Calculate_and_set_Abstractness_for_Typescript.cypher](./cypher/Metrics/Calculate_and_set_Abstractness_for_Typescript.cypher) | Metrics | Calculate and set Abstractness for Typescript Modules | +| [Calculate_and_set_Instability_for_Java_Including_Subpackages.cypher](./cypher/Metrics/Calculate_and_set_Instability_for_Java_Including_Subpackages.cypher) | Metrics | Calculate and set Instability = outgoing / (outgoing + incoming) Dependencies. Requires "Add_file_name and_extension.cypher". | +| [Calculate_and_set_Instability_for_Java.cypher](./cypher/Metrics/Calculate_and_set_Instability_for_Java.cypher) | Metrics | Calculate and set Instability for Java. Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | +| [Calculate_and_set_Instability_for_Typescript.cypher](./cypher/Metrics/Calculate_and_set_Instability_for_Typescript.cypher) | Metrics | Calculate and set Instability = outgoing / (outgoing + incoming) Dependencies | +| [Calculate_distance_between_abstractness_and_instability_for_Java_including_subpackages.cypher](./cypher/Metrics/Calculate_distance_between_abstractness_and_instability_for_Java_including_subpackages.cypher) | Metrics | Calculate distance between abstractness and instability including subpackages. Requires "Add_file_name and_extension.cypher". | +| [Calculate_distance_between_abstractness_and_instability_for_Java.cypher](./cypher/Metrics/Calculate_distance_between_abstractness_and_instability_for_Java.cypher) | Metrics | Calculate distance between abstractness and instability. Requires "Add_file_name and_extension.cypher". | +| [Calculate_distance_between_abstractness_and_instability_for_Typescript.cypher](./cypher/Metrics/Calculate_distance_between_abstractness_and_instability_for_Typescript.cypher) | Metrics | Calculate distance between abstractness and instability for Typescript | +| [Clear_all_metrics.cypher](./cypher/Metrics/Clear_all_metrics.cypher) | Metrics | Clear all object oriented design metrics | +| [Count_and_set_abstract_types.cypher](./cypher/Metrics/Count_and_set_abstract_types.cypher) | Metrics | Count and set abstract types | +| [Get_Abstractness_for_Java_including_Subpackages.cypher](./cypher/Metrics/Get_Abstractness_for_Java_including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the lowest abstractness first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Abstractness_for_Java.cypher](./cypher/Metrics/Get_Abstractness_for_Java.cypher) | Metrics | Get Java Packages with the lowest abstractness first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Abstractness_for_Typescript.cypher](./cypher/Metrics/Get_Abstractness_for_Typescript.cypher) | Metrics | Get Typscript Modules with the lowest abstractness first (if set before) | +| [Get_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Get_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub-packages with the most incoming dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Incoming_Java_Package_Dependencies.cypher](./cypher/Metrics/Get_Incoming_Java_Package_Dependencies.cypher) | Metrics | Get Java Packages with the most incoming dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Incoming_Typescript_Module_Dependencies.cypher](./cypher/Metrics/Get_Incoming_Typescript_Module_Dependencies.cypher) | Metrics | Get Typscript Modules with the most incoming dependencies first (if set before) | +| [Get_Instability_for_Java_Including_Subpackages.cypher](./cypher/Metrics/Get_Instability_for_Java_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the lowest Instability. Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | +| [Get_Instability_for_Java.cypher](./cypher/Metrics/Get_Instability_for_Java.cypher) | Metrics | Get Java Packages with the lowest Instability (outgoing / all dependencies) first (if set before). Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | +| [Get_Instability_for_Typescript.cypher](./cypher/Metrics/Get_Instability_for_Typescript.cypher) | Metrics | Get Typscript Modules with the lowest Instability (outgoing / all dependencies) first (if set before) | +| [Get_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Get_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the most outgoing dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Outgoing_Java_Package_Dependencies.cypher](./cypher/Metrics/Get_Outgoing_Java_Package_Dependencies.cypher) | Metrics | Get Java Packages with the most outgoing dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | +| [Get_Outgoing_Typescript_Module_Dependencies.cypher](./cypher/Metrics/Get_Outgoing_Typescript_Module_Dependencies.cypher) | Metrics | Get Typscript Modules with the most outgoing dependencies first (if set before) | +| [Incoming_Class_Dependencies.cypher](./cypher/Metrics/Incoming_Class_Dependencies.cypher) | Metrics | Incoming Class Dependencies | +| [Incoming_Class_Method_Call_Dependencies.cypher](./cypher/Metrics/Incoming_Class_Method_Call_Dependencies.cypher) | Metrics | Incoming Class Method Call Dependencies | +| [Incoming_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Incoming_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Incoming Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | +| [Incoming_Package_Dependencies.cypher](./cypher/Metrics/Incoming_Package_Dependencies.cypher) | Metrics | Incoming Package Dependencies. Requires "Add_file_name and_extension.cypher". | +| [Incoming_Package_Method_Call_Dependencies.cypher](./cypher/Metrics/Incoming_Package_Method_Call_Dependencies.cypher) | Metrics | Incoming Package Method Call Dependencies | +| [Outgoing_Class_Dependencies.cypher](./cypher/Metrics/Outgoing_Class_Dependencies.cypher) | Metrics | Outgoing Class Dependencies | +| [Outgoing_Class_Method_Call_Dependencies.cypher](./cypher/Metrics/Outgoing_Class_Method_Call_Dependencies.cypher) | Metrics | Outgoing Class Method Call Dependencies | +| [Outgoing_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Outgoing_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Outgoing Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | +| [Outgoing_Package_Dependencies.cypher](./cypher/Metrics/Outgoing_Package_Dependencies.cypher) | Metrics | Outgoing Package Dependencies. Requires "Add_file_name and_extension.cypher". | +| [Outgoing_Package_Method_Call_Dependencies.cypher](./cypher/Metrics/Outgoing_Package_Method_Call_Dependencies.cypher) | Metrics | Outgoing Package Method Call Dependencies | +| [Set_Dependency_Degree_Rank.cypher](./cypher/Metrics/Set_Dependency_Degree_Rank.cypher) | Metrics | Set "dependencyDegreeRank" on all nodes containing a "dependencyDegree" property. Requires "Set_Degree.cypher". | +| [Set_Dependency_Degree.cypher](./cypher/Metrics/Set_Dependency_Degree.cypher) | Metrics | Set "dependencyDegree" and "dependencyDegreeWeighted" on all nodes containing a property for incoming or outgoing dependencies. Requires all "Set_Incoming*.cypher" and "Set_Outgoing*.cypher". | +| [Set_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Set_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Set Incoming Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | +| [Set_Incoming_Java_Package_Dependencies.cypher](./cypher/Metrics/Set_Incoming_Java_Package_Dependencies.cypher) | Metrics | Set Incoming Package Dependencies. Requires "Add_file_name and_extension.cypher". | +| [Set_Incoming_Java_Package_Method_Call_Dependencies.cypher](./cypher/Metrics/Set_Incoming_Java_Package_Method_Call_Dependencies.cypher) | Metrics | Set Incoming Package Method Call Dependencies | +| [Set_Incoming_Java_Type_Dependencies.cypher](./cypher/Metrics/Set_Incoming_Java_Type_Dependencies.cypher) | Metrics | Set Incoming Type Dependencies | +| [Set_Incoming_Typescript_Module_Dependencies.cypher](./cypher/Metrics/Set_Incoming_Typescript_Module_Dependencies.cypher) | Metrics | Set incoming Typscript Module dependencies | +| [Set_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher](./cypher/Metrics/Set_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Set Outgoing Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | +| [Set_Outgoing_Java_Package_Dependencies.cypher](./cypher/Metrics/Set_Outgoing_Java_Package_Dependencies.cypher) | Metrics | Set Outgoing Package Dependencies. Requires "Add_file_name and_extension.cypher". | +| [Set_Outgoing_Java_Package_Method_Call_Dependencies.cypher](./cypher/Metrics/Set_Outgoing_Java_Package_Method_Call_Dependencies.cypher) | Metrics | Set Outgoing Package Method Call Dependencies | +| [Set_Outgoing_Java_Type_Dependencies.cypher](./cypher/Metrics/Set_Outgoing_Java_Type_Dependencies.cypher) | Metrics | Set Outgoing Type Dependencies | +| [Set_Outgoing_Typescript_Module_Dependencies.cypher](./cypher/Metrics/Set_Outgoing_Typescript_Module_Dependencies.cypher) | Metrics | Set outgoing Typscript Module dependencies | +| [Adding_the_artifact_name_temporarily_to_a_new_virtual_node_using_APOC.cypher](./cypher/Miscellaneous/Adding_the_artifact_name_temporarily_to_a_new_virtual_node_using_APOC.cypher) | Miscellaneous | Adding the artifact name temporarily to a new virtual node using APOC. Doesn't take all relationships into account and therefore doesn't work yet. | +| [Adding_the_artifact_name_temporarily_to_the_Package_node_using_map_projection.cypher](./cypher/Miscellaneous/Adding_the_artifact_name_temporarily_to_the_Package_node_using_map_projection.cypher) | Miscellaneous | Adding the artifact name temporarily to the Package node using map projection | +| [Extract_Custom_Manifest_Entries.cypher](./cypher/Miscellaneous/Extract_Custom_Manifest_Entries.cypher) | Miscellaneous | Extract Custom Manifest Entries | +| [Get_Awesome_Procedures_On_Cypher_APOC_Version.cypher](./cypher/Miscellaneous/Get_Awesome_Procedures_On_Cypher_APOC_Version.cypher) | Miscellaneous | Get Awesome Procedures On Cypher APOC Version | +| [Get_Graph_Data_Science_Library_Version.cypher](./cypher/Miscellaneous/Get_Graph_Data_Science_Library_Version.cypher) | Miscellaneous | Get Graph Data Science Library Version | +| [Get_Graph_Data_Science_System_Information.cypher](./cypher/Miscellaneous/Get_Graph_Data_Science_System_Information.cypher) | Miscellaneous | Get Graph Data Science System Information | +| [Set_artifactName_property_on_every_Package_node.cypher](./cypher/Miscellaneous/Set_artifactName_property_on_every_Package_node.cypher) | Miscellaneous | Set artifactName property on every Package node. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_0a_Query_Calculated.cypher](./cypher/Node_Embeddings/Node_Embeddings_0a_Query_Calculated.cypher) | Node_Embeddings | Query already calculated and written node embeddings on nodes with label in parameter $dependencies_projection_node including a communityId and centrality. Variables: dependencies_projection_node, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_0b_Prepare_Degree.cypher](./cypher/Node_Embeddings/Node_Embeddings_0b_Prepare_Degree.cypher) | Node_Embeddings | Node Embeddings 0b: Prepare: Calculate Degree Property. | +| [Node_Embeddings_0c_Drop_Model.cypher](./cypher/Node_Embeddings/Node_Embeddings_0c_Drop_Model.cypher) | Node_Embeddings | Node Embeddings 0b: Prepare: Calculate Degree Property. | +| [Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher](./cypher/Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher) | Node_Embeddings | Node Embeddings 1a using Fast Random Projection: Estimate | +| [Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher](./cypher/Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher) | Node_Embeddings | Node Embeddings 1b using Fast Random Projection: Statistics | +| [Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher](./cypher/Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher) | Node_Embeddings | Node Embeddings 1c using Fast Random Projection: Mutate | +| [Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Stream. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_1d_Fast_Random_Projection_Tuneable_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Stream for Hyper-Parameter tuning. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_1e_Fast_Random_Projection_Tuneable_Write.cypher](./cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Tuneable_Write.cypher) | Node_Embeddings | Node Embeddings 1e using Fast Random Projection: Write for tuned hyper-parameters. | +| [Node_Embeddings_1e_Fast_Random_Projection_Write.cypher](./cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Write | +| [Node_Embeddings_2a_Hash_GNN_Estimate.cypher](./cypher/Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher) | Node_Embeddings | Node Embeddings 2a using Hash GNN (Graph Neural Networks): Estimate | +| [Node_Embeddings_2c_Hash_GNN_Mutate.cypher](./cypher/Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher) | Node_Embeddings | Node Embeddings 2b using Hash GNN (Graph Neural Networks): Mutate | +| [Node_Embeddings_2d_Hash_GNN_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher) | Node_Embeddings | Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_2d_Hash_GNN_Tuneable_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_3a_Node2Vec_Estimate.cypher](./cypher/Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher) | Node_Embeddings | Node Embeddings 3a using Node2Vec: Estimate | +| [Node_Embeddings_3c_Node2Vec_Mutate.cypher](./cypher/Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Mutate | +| [Node_Embeddings_3d_Node2Vec_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Stream. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_3d_Node2Vec_Tuneable_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Stream. Requires "Add_file_name and_extension.cypher". | +| [Node_Embeddings_3e_Node2Vec_Write.cypher](./cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher) | Node_Embeddings | Node Embeddings 3d using Node2Vec: Write | +| [Node_Embeddings_4b_GraphSAGE_Train.cypher](./cypher/Node_Embeddings/Node_Embeddings_4b_GraphSAGE_Train.cypher) | Node_Embeddings | Node Embeddings 4c using GraphSAGE (Graph Neural Networks): Train. Requires: "Node_Embeddings_0b_Prepare_Degree.cypher". | +| [Node_Embeddings_4d_GraphSAGE_Stream.cypher](./cypher/Node_Embeddings/Node_Embeddings_4d_GraphSAGE_Stream.cypher) | Node_Embeddings | Node Embeddings 4d using GraphSAGE: Stream. Requires "Add_file_name and_extension.cypher". | +| [Set_Parameters.cypher](./cypher/Node_Embeddings/Set_Parameters.cypher) | Node_Embeddings | Example on how to set the parameters for node embeddings in this case for Packages and Node2Vec | +| [Cyclomatic_Method_Complexity_Distribution.cypher](./cypher/Overview/Cyclomatic_Method_Complexity_Distribution.cypher) | Overview | Cyclomatic Complexity Method Complexity Distribution | +| [Dependency_node_labels.cypher](./cypher/Overview/Dependency_node_labels.cypher) | Overview | Explore DEPENDS_ON relationship node labels | +| [Effective_lines_of_method_code_per_package.cypher](./cypher/Overview/Effective_lines_of_method_code_per_package.cypher) | Overview | Effective lines of method code per package. Requires "Add_file_name and_extension.cypher". | +| [Effective_lines_of_method_code_per_type.cypher](./cypher/Overview/Effective_lines_of_method_code_per_type.cypher) | Overview | Effective lines of method code per type. Requires "Add_file_name and_extension.cypher". | +| [Effective_Method_Line_Count_Distribution.cypher](./cypher/Overview/Effective_Method_Line_Count_Distribution.cypher) | Overview | Effective Method Line Count Distribution | +| [Node_label_combination_count.cypher](./cypher/Overview/Node_label_combination_count.cypher) | Overview | Node count for each label combination. Sums up to the total number of nodes. | +| [Node_label_count.cypher](./cypher/Overview/Node_label_count.cypher) | Overview | Node count for each label separate. Doesn_t sum up to the number of total labels since one node can have multiple labels. | +| [Node_labels_and_their_relationships.cypher](./cypher/Overview/Node_labels_and_their_relationships.cypher) | Overview | List node labels and their relationship types, their count and their density. | +| [Number_of_elements_per_module_for_Typescript.cypher](./cypher/Overview/Number_of_elements_per_module_for_Typescript.cypher) | Overview | Number of elements per module for Typescript | +| [Number_of_packages_per_artifact.cypher](./cypher/Overview/Number_of_packages_per_artifact.cypher) | Overview | Number of packages per artifact. Requires "Add_file_name and_extension.cypher". | +| [Number_of_types_per_artifact.cypher](./cypher/Overview/Number_of_types_per_artifact.cypher) | Overview | Number of types per artifact. Requires "Add_file_name and_extension.cypher". | +| [Overview_size_for_Typescript.cypher](./cypher/Overview/Overview_size_for_Typescript.cypher) | Overview | Overview size for Typescript | +| [Overview_size.cypher](./cypher/Overview/Overview_size.cypher) | Overview | Overview size | +| [Relationship_type_count.cypher](./cypher/Overview/Relationship_type_count.cypher) | Overview | Relationship count for each type separate. Sums up to the total number of relationships (100%). | +| [Words_for_git_author_Wordcloud_with_frequency.cypher](./cypher/Overview/Words_for_git_author_Wordcloud_with_frequency.cypher) | Overview | Wordcloud of git authors and their commit count | +| [Words_for_universal_Wordcloud.cypher](./cypher/Overview/Words_for_universal_Wordcloud.cypher) | Overview | Words for universal Wordcloud | +| [Words_for_Wordcloud.cypher](./cypher/Overview/Words_for_Wordcloud.cypher) | Overview | Words for Wordcloud | +| [Set_Parameters.cypher](./cypher/Similarity/Set_Parameters.cypher) | Similarity | Example on how to set the parameters for similarity in this case for Packages and Node Similarity | +| [Similarity_1a_Estimate.cypher](./cypher/Similarity/Similarity_1a_Estimate.cypher) | Similarity | Similarity Estimate Memory | +| [Similarity_1b_Statistics.cypher](./cypher/Similarity/Similarity_1b_Statistics.cypher) | Similarity | Similarity Statistics | +| [Similarity_1c_Mutate.cypher](./cypher/Similarity/Similarity_1c_Mutate.cypher) | Similarity | Similarity Mutate | +| [Similarity_1d_Stream_Mutated.cypher](./cypher/Similarity/Similarity_1d_Stream_Mutated.cypher) | Similarity | Read the similarity relationship from the projection. Variables: dependencies_projection. Requires "Add_file_name and_extension.cypher". | +| [Similarity_1e_Stream.cypher](./cypher/Similarity/Similarity_1e_Stream.cypher) | Similarity | Similarity Stream. Requires "Add_file_name and_extension.cypher". | +| [Similarity_1f_Delete_Relationships.cypher](./cypher/Similarity/Similarity_1f_Delete_Relationships.cypher) | Similarity | Delete Relationship "SIMILAR" | +| [Similarity_1g_Write_Mutated.cypher](./cypher/Similarity/Similarity_1g_Write_Mutated.cypher) | Similarity | Write the Similarity relationship from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | +| [Similarity_1h_Write.cypher](./cypher/Similarity/Similarity_1h_Write.cypher) | Similarity | Similarity Write | +| [Similarity_1i_Write_Node_Properties.cypher](./cypher/Similarity/Similarity_1i_Write_Node_Properties.cypher) | Similarity | Write similar node names and their score per node | +| [Label_base_java_types.cypher](./cypher/Types/Label_base_java_types.cypher) | Types | Label primitive Java types and void | +| [Label_buildin_java_types.cypher](./cypher/Types/Label_buildin_java_types.cypher) | Types | Label build-in Java types | +| [Label_resolved_duplicate_types.cypher](./cypher/Types/Label_resolved_duplicate_types.cypher) | Types | Label resolved duplicate types. | +| [Remove_extended_type_labels.cypher](./cypher/Types/Remove_extended_type_labels.cypher) | Types | Remove external type and annotation labels | +| [Set_declaring_type_on_method_nodes.cypher](./cypher/Types/Set_declaring_type_on_method_nodes.cypher) | Types | Set property "declaringType" on Method nodes. | +| [Add_DEPENDS_ON_relationship_to_resolved_modules.cypher](./cypher/Typescript_Enrichment/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher) | Typescript_Enrichment | Propagates "DEPENDS_ON" relations between modules to their resolved modules with a property "resolved:true" or "updated:true". Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5 | +| [Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher](./cypher/Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher) | Typescript_Enrichment | Link matching external to internal Typescript declarations with an IS_IMPLEMENTED_IN relationship | +| [Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher](./cypher/Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher) | Typescript_Enrichment | Adds a relation "IS_IMPLEMENTED_IN" from an external module to a module if their global fully qualified names match. Depends on "Add_module_properties.cypher" to be run first Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5 Related to https://github.com/jqassistant-plugin/jqassistant-typescript-plugin/issues/35 | +| [Add_module_properties.cypher](./cypher/Typescript_Enrichment/Add_module_properties.cypher) | Typescript_Enrichment | Add extended properties to Typescript nodes with a globalFqn like "namespace", "module", "name" and "extension" as well as markers like "isNodeModule", "isUnresolvedImport" and "isExternalImport" | +| [Add_name_to_property_on_projects.cypher](./cypher/Typescript_Enrichment/Add_name_to_property_on_projects.cypher) | Typescript_Enrichment | Set name property on Typescript project nodes | +| [Add_name_to_property_on_scan_nodes.cypher](./cypher/Typescript_Enrichment/Add_name_to_property_on_scan_nodes.cypher) | Typescript_Enrichment | Set name property on Typescript scan nodes | +| [Add_namespace_property_on_nodes_from_linked_npm_packages.cypher](./cypher/Typescript_Enrichment/Add_namespace_property_on_nodes_from_linked_npm_packages.cypher) | Typescript_Enrichment | Add namespace property to Typescript nodes if a npm a package is linked. Requires Link_projects_to_npm_packages. | +| [Count_internal_modules_resolving_external_ones.cypher](./cypher/Typescript_Enrichment/Count_internal_modules_resolving_external_ones.cypher) | Typescript_Enrichment | How many internal modules resolve/represent external ones (for manual exploration)? | +| [Enrich_npm_packages_with_dependency_counts.cypher](./cypher/Typescript_Enrichment/Enrich_npm_packages_with_dependency_counts.cypher) | Typescript_Enrichment | Enrich NPM:Package nodes with incoming and outgoing dependency counts Requires Link_npm_packages_with_depends_on_relationships.cypher | +| [Index_module_name.cypher](./cypher/Typescript_Enrichment/Index_module_name.cypher) | Typescript_Enrichment | Create index for module name | +| [Label_npm_packages_by_dep_type.cypher](./cypher/Typescript_Enrichment/Label_npm_packages_by_dep_type.cypher) | Typescript_Enrichment | Label NPM packages as NpmDevPackage or NpmNonDevPackage based on incoming DEPENDS_ON. Requires Link_npm_packages_with_depends_on_relationships.cypher For each package node, calculate the maximum `weightByDependencyType` across incoming `DEPENDS_ON` relationships. If the max is 1 -> label `NpmDevPackage`; if > 1 -> label `NpmNonDevPackage`. If the property is missing or < 1 then no label is added. weightByDependencyType= 1 is a dev dependency, 2 is a regular dependency, and 3 is a peer dependency. | +| [Link_external_modules_to_corresponding_npm_dependency.cypher](./cypher/Typescript_Enrichment/Link_external_modules_to_corresponding_npm_dependency.cypher) | Typescript_Enrichment | Link ExternalModule nodes to their corresponding NPM Dependency if available | +| [Link_npm_dependencies_to_npm_packages.cypher](./cypher/Typescript_Enrichment/Link_npm_dependencies_to_npm_packages.cypher) | Typescript_Enrichment | Link npm dependencies to the npm package that describes them, if it exists | +| [Link_npm_packages_with_depends_on_relationships.cypher](./cypher/Typescript_Enrichment/Link_npm_packages_with_depends_on_relationships.cypher) | Typescript_Enrichment | Link npm packages with DEPENDS_ON relationships. Requires Link_npm_dependencies_to_npm_packages. This creates direct package-to-package dependencies by following the chain: (source:NPM:Package)-[dependency_relationship]->(NPM:Dependency)-[:IS_DESCRIBED_IN_NPM_PACKAGE]->(target:NPM:Package) | +| [Link_projects_to_npm_packages.cypher](./cypher/Typescript_Enrichment/Link_projects_to_npm_packages.cypher) | Typescript_Enrichment | Link Typescript projects to npm packages | +| [Mark_test_modules.cypher](./cypher/Typescript_Enrichment/Mark_test_modules.cypher) | Typescript_Enrichment | Add "Test" label for modules that contain tests and test-related implementations | +| [Remove_duplicate_CONTAINS_relations_between_files.cypher](./cypher/Typescript_Enrichment/Remove_duplicate_CONTAINS_relations_between_files.cypher) | Typescript_Enrichment | Remove duplicate CONTAINS relationships with the same properties between files | +| [Remove_npm_dependency_type_labels.cypher](./cypher/Typescript_Enrichment/Remove_npm_dependency_type_labels.cypher) | Typescript_Enrichment | Remove NPM package type labels (idempotent). | +| [Set_localRootPath_for_modules.cypher](./cypher/Typescript_Enrichment/Set_localRootPath_for_modules.cypher) | Typescript_Enrichment | Set "rootProjectName" and some local path properties for Typescript modules | +| [Verify_module_dependencies.cypher](./cypher/Typescript_Enrichment/Verify_module_dependencies.cypher) | Typescript_Enrichment | Verify that there are either no Typescript modules at all or that there is at least one module dependency. | +| [Verify_projects_linked_to_npm_packages.cypher](./cypher/Typescript_Enrichment/Verify_projects_linked_to_npm_packages.cypher) | Typescript_Enrichment | Verify that all Typescript projects are linked to npm packages | +| [ValidateAlwaysFalse.cypher](./cypher/Validation/ValidateAlwaysFalse.cypher) | Validation | Will never return any results so that the validation will always fail. This is helpful for Jupyter Notebooks that should not be executed automatically. | +| [ValidateGitHistory.cypher](./cypher/Validation/ValidateGitHistory.cypher) | Validation | Check if there is at least one Git:Commit pointing to a Git:Change containing a Git:File from a Git:Repository | +| [ValidateJavaArtifactDependencies.cypher](./cypher/Validation/ValidateJavaArtifactDependencies.cypher) | Validation | Check if there is at least one Java Artifact dependency. | +| [ValidateJavaExternalDependencies.cypher](./cypher/Validation/ValidateJavaExternalDependencies.cypher) | Validation | Check if there is at least one external Java Type dependency. | +| [ValidateJavaInternalDependencies.cypher](./cypher/Validation/ValidateJavaInternalDependencies.cypher) | Validation | Check if there is at least one Java Artifact containing a Java Package with at least one Java Type. | +| [ValidateJavaMethods.cypher](./cypher/Validation/ValidateJavaMethods.cypher) | Validation | Check if there is at least one Java Method, its Type and an Artifact it belongs to. | +| [ValidateJavaPackageDependencies.cypher](./cypher/Validation/ValidateJavaPackageDependencies.cypher) | Validation | Check if there is at least one Java Packagte dependency. | +| [ValidateJavaTypes.cypher](./cypher/Validation/ValidateJavaTypes.cypher) | Validation | Check if there is at least one Java Method, its Type and an Artifact it belongs to. | +| [ValidateTypescriptModuleDependencies.cypher](./cypher/Validation/ValidateTypescriptModuleDependencies.cypher) | Validation | Check if there is at least one Typescript Module dependency. | +| [Global_relative_visibility_statistics_for_elements_for_Typescript.cypher](./cypher/Visibility/Global_relative_visibility_statistics_for_elements_for_Typescript.cypher) | Visibility | Global relative visibility statistics for elements for Typescript | +| [Global_relative_visibility_statistics_for_types.cypher](./cypher/Visibility/Global_relative_visibility_statistics_for_types.cypher) | Visibility | Global relative visibility statistics for types. Requires "Add_file_name and_extension.cypher". | +| [Relative_visibility_exported_elements_to_all_elements_per_module_for_Typescript.cypher](./cypher/Visibility/Relative_visibility_exported_elements_to_all_elements_per_module_for_Typescript.cypher) | Visibility | Relative visibility: exported elements to all elements per module | +| [Relative_visibility_public_types_to_all_types_per_package.cypher](./cypher/Visibility/Relative_visibility_public_types_to_all_types_per_package.cypher) | Visibility | Relative visibility: public types to all types per package. Requires "Add_file_name and_extension.cypher". | +| [AnomalyDetectionFeature_Abstractness_Java.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature_Abstractness_Java.cypher) | features | Calculate and set abstractness for Java Code Packages or Artifacts and return a 0.1 ranged bin distribution. | +| [AnomalyDetectionFeature_Abstractness_JavaType.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature_Abstractness_JavaType.cypher) | features | Calculate and set abstractness for Java Types and returns the distribution. | +| [AnomalyDetectionFeature_Abstractness_TypeScriptModule.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature_Abstractness_TypeScriptModule.cypher) | features | Calculate and set Abstractness for TypeScript Modules. | +| [AnomalyDetectionFeature-Abstractness-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-Abstractness-Exists.cypher) | features | Return the first node with the property "abstractness" if it exists | +| [AnomalyDetectionFeature-ArticleRank-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-ArticleRank-Exists.cypher) | features | Return the first node with a centralityArticleRank if it exists | +| [AnomalyDetectionFeature-ArticleRank-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-ArticleRank-Write.cypher) | features | Calculates and writes the Article Rank centrality score for anomaly detection | +| [AnomalyDetectionFeature-Betweenness-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-Betweenness-Exists.cypher) | features | Return the first node with a centralityBetweenness if it exists | +| [AnomalyDetectionFeature-Betweenness-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-Betweenness-Write.cypher) | features | Calculates and writes the Betweeness centrality score for anomaly detection | +| [AnomalyDetectionFeature-LocalClusteringCoefficient-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-LocalClusteringCoefficient-Exists.cypher) | features | Return the first node with a clusteringCoefficient if it exists | +| [AnomalyDetectionFeature-LocalClusteringCoefficient-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-LocalClusteringCoefficient-Write.cypher) | features | Calculates and writes the local clustering coefficient for anomaly detection | +| [AnomalyDetectionFeature-PageRank-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-PageRank-Exists.cypher) | features | Return the first node with a centralityPageRank if it exists | +| [AnomalyDetectionFeature-PageRank-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-PageRank-Write.cypher) | features | Calculates and writes the Page Rank centrality score for anomaly detection | +| [AnomalyDetectionFeature-PageToArticleRank-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-PageToArticleRank-Exists.cypher) | features | Return the first node with (amongst others) a "centralityPageRankToArticleRankDifference" property if it exists | +| [AnomalyDetectionFeature-PageToArticleRank-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-PageToArticleRank-Write.cypher) | features | Calculates and writes the (amongst others) "centralityPageRankToArticleRankDifference" property. | +| [AnomalyDetectionFeature-StronglyConnectedComponents-CreateDependency.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-StronglyConnectedComponents-CreateDependency.cypher) | features | Create nodes for strongly connected components and connect them to their members. Requires "AnomalyDetectionFeature-StronglyConnectedComponents-CreateNode". | +| [AnomalyDetectionFeature-StronglyConnectedComponents-CreateNode.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-StronglyConnectedComponents-CreateNode.cypher) | features | Create nodes for strongly connected components and connect them to their members. Requires "AnomalyDetectionFeature-StronglyConnectedComponents-Write.cypher". | +| [AnomalyDetectionFeature-StronglyConnectedComponents-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-StronglyConnectedComponents-Exists.cypher) | features | Return the first node with a "communityStronglyConnectedComponentId" if it exists | +| [AnomalyDetectionFeature-StronglyConnectedComponents-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-StronglyConnectedComponents-Write.cypher) | features | Calculates and writes the Strongly Connected Components for anomaly detection | +| [AnomalyDetectionFeature-TopologicalSortComponents-Delete-Projection.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-TopologicalSortComponents-Delete-Projection.cypher) | features | Delete projection if existing. Variables: projection_name | +| [AnomalyDetectionFeature-TopologicalSortComponents-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-TopologicalSortComponents-Exists.cypher) | features | Return the first node with a "topologicalSortMaxDistanceFromSource" if it exists | +| [AnomalyDetectionFeature-TopologicalSortComponents-Projection.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-TopologicalSortComponents-Projection.cypher) | features | Creates a projection of the strongly connected components graph for the given member type. Requires: "AnomalyDetectionFeature-StronglyConnectedComponents-CreateDependency.cypher" | +| [AnomalyDetectionFeature-TopologicalSortComponents-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-TopologicalSortComponents-Write.cypher) | features | Topological Sort to write the property "topologicalSortMaxDistanceFromSource" (e.g. build order) for strongly connected components into the graph. Requires "AnomalyDetectionFeature-TopologicalSortComponents-Projection". Needs graph-data-science plugin version >= 2.5.0 | +| [AnomalyDetectionFeature-WeaklyConnectedComponents-CreateNode.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-WeaklyConnectedComponents-CreateNode.cypher) | features | Create nodes for weakly connected components and connect them to their members. Requires "AnomalyDetectionFeature-StronglyConnectedComponents-CreateNode.cypher". | +| [AnomalyDetectionFeature-WeaklyConnectedComponents-Exists.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-WeaklyConnectedComponents-Exists.cypher) | features | Return the first node with a "communityWeaklyConnectedComponentId" if it exists | +| [AnomalyDetectionFeature-WeaklyConnectedComponents-Write.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeature-WeaklyConnectedComponents-Write.cypher) | features | Calculates and writes the Weakly Connected Components for anomaly detection | +| [AnomalyDetectionFeatures.cypher](./domains/anomaly-detection/features/AnomalyDetectionFeatures.cypher) | features | Query code unit nodes with their anomaly detection | +| [Set_Parameters_Manual.cypher](./domains/anomaly-detection/features/Set_Parameters_Manual.cypher) | features | Example on how to set the parameters for anomaly detection | +| [TopAuthority.cypher](./domains/anomaly-detection/graphs/TopAuthority.cypher) | graphs | Anomaly Detection Graphs: Find top nodes marked as "Authority" including their incoming and outgoing dependencies, sizes based on PageRank and thick outline for nodes with high Page Rank to Article Rank difference in Graphviz format. | +| [TopBottleneck.cypher](./domains/anomaly-detection/graphs/TopBottleneck.cypher) | graphs | Anomaly Detection Graphs: Find top nodes marked as "Bottleneck" including their incoming and outgoing dependencies and output them in Graphviz format. | +| [TopBridge.cypher](./domains/anomaly-detection/graphs/TopBridge.cypher) | graphs | Anomaly Detection Graphs: Find top nodes marked as "Bridge" including their incoming and outgoing dependencies and output them in Graphviz format. | +| [TopHub.cypher](./domains/anomaly-detection/graphs/TopHub.cypher) | graphs | Anomaly Detection Graphs: Find top nodes marked as "Hub" including their incoming and outgoing dependencies and output them in Graphviz format. | +| [TopOutlier.cypher](./domains/anomaly-detection/graphs/TopOutlier.cypher) | graphs | Anomaly Detection Graphs: Find top nodes marked as "Outlier" including their incoming and outgoing dependencies and sizes based on cluster confidence and output them in Graphviz format. | +| [AnomalyDetectionArchetypeAuthority.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeAuthority.cypher) | labels | Anomaly Detection Labels: Label code units of archetype "Authority" by looking for the (at most) top 20 entries with a high PageRank >= 90% percentile and a high PageRank to ArticleRank difference >= 95% percentile. Requires features/*.cypher to be run first. Shows code that is referenced widely but not strongly contributing back (utility libraries, framework entry points) | +| [AnomalyDetectionArchetypeBottleneck.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeBottleneck.cypher) | labels | Anomaly Detection Labels: Label code units of archetype "Bottleneck" by looking for the top 20 entries with the highest Betweeenness centrality >= 90% percentile. Requires features/*.cypher to be run first. Shows key code that is both heavily depended on and control flow — critical hubs. Potentially an unintended dependency concentration: if removed, communication between modules breaks. | +| [AnomalyDetectionArchetypeBridge.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeBridge.cypher) | labels | Anomaly Detection Labels: Label code units of archetype "Bridge" by looking for the (at most) top 20 entries with the sum of the "nodeEmbedding" anomaly detection feature SHAP (explainable AI) values. Requires anomalyDetectionExplained.py to be run first. Shows code that integrates various layers or boundaries (e.g., API facades) or violates architecture (tangled dependencies). | +| [AnomalyDetectionArchetypeHub.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeHub.cypher) | labels | Anomaly Detection Labels: Label code units of archetype "Hub" by looking for the (at most) top 20 entries with the highest degree >= 90% percentile and a local clustering coefficient <= 10% percentile. Requires features/*.cypher to be run first. Shows code with many connections that are not well integrated into a cluster. | +| [AnomalyDetectionArchetypeOutlier.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeOutlier.cypher) | labels | Anomaly Detection Query: Find code units of archetype "Outlier" by listing the (at most) top 20 entries with a normalized distance to the cluster medoid (center) >= 90% percentile and a clustering probability (1.0 - approximate cluster outlier score) <= 30% percentile. Requires tunedNodeEmbeddingClustering.py to be run first. Shows code that doesn't clearly fit into any architectural layer or domain boundary cleanly. | +| [AnomalyDetectionArchetypeRemoveLabels.cypher](./domains/anomaly-detection/labels/AnomalyDetectionArchetypeRemoveLabels.cypher) | labels | Anomaly Detection Labels: Reset/Remove all marker labels intended to be used before setting them for a clean state. | +| [AnomalyDetectionTopAnomalies.cypher](./domains/anomaly-detection/labels/AnomalyDetectionTopAnomalies.cypher) | labels | List top anomalies | +| [AnomalyDetectionDependencyHungryOrchestrators.cypher](./domains/anomaly-detection/queries/AnomalyDetectionDependencyHungryOrchestrators.cypher) | queries | Anomaly Detection Query: Find dependency hungry orchestrators by listing the top (at most) 20 entries with the highest Article Rank >= 90% percentile and a Betweeenness centrality >= 90% percentile. Shows key code that depend on many others and also controls flow — likely orchestrators or managers. | +| [AnomalyDetectionFiles.cypher](./domains/anomaly-detection/queries/AnomalyDetectionFiles.cypher) | queries | List anomalous files | +| [AnomalyDetectionFragileStructuralBridges.cypher](./domains/anomaly-detection/queries/AnomalyDetectionFragileStructuralBridges.cypher) | queries | Anomaly Detection Query: Find fragile structural bridges, potential boundary-spanning modules and cohesion violations by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a local clustering coefficient <= 10% percentile. Shows code that connects otherwise unrelated parts of the graph — potential architectural risks. | +| [AnomalyDetectionHiddenBridgeNodes.cypher](./domains/anomaly-detection/queries/AnomalyDetectionHiddenBridgeNodes.cypher) | queries | Anomaly Detection Query: Find hidden bridge code or misplaced responsibilities by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank <= 10% percentile. Shows code that mediates flow, but isn’t highly depended on — structural surprise. | +| [AnomalyDetectionNodeCount.cypher](./domains/anomaly-detection/queries/AnomalyDetectionNodeCount.cypher) | queries | Count the number of nodes with dependencies. Variables: dependencies_projection_node, dependencies_projection_weight_property | +| [AnomalyDetectionOverReferencesUtilities.cypher](./domains/anomaly-detection/queries/AnomalyDetectionOverReferencesUtilities.cypher) | queries | Anomaly Detection Query: Find over-referenced utility code by listing the (at most) top 20 entries with the highest Page Rank >= 90% percentile and a low local clustering coefficient below the 10% percentile. Shows code that is widely referenced, but loosely coupled in neighborhood — could be over-generalized or abused. | +| [AnomalyDetectionPopularBottlenecks.cypher](./domains/anomaly-detection/queries/AnomalyDetectionPopularBottlenecks.cypher) | queries | Anomaly Detection Query: Find popular bottlenecks by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank >= 90% percentile. Shows key code that is both heavily depended on and control flow — critical hubs. | +| [AnomalyDetectionPotentialImbalancedRoles.cypher](./domains/anomaly-detection/queries/AnomalyDetectionPotentialImbalancedRoles.cypher) | queries | Anomaly Detection Query: Find potential imbalanced roles in the codebase by listing the (at most) top 20 most significant Page Rank to Article Rank differences. | +| [AnomalyDetectionPotentialOverEngineerOrIsolated.cypher](./domains/anomaly-detection/queries/AnomalyDetectionPotentialOverEngineerOrIsolated.cypher) | queries | Anomaly Detection Query: Find potential over-engineered or isolated code unit by listing the (at most) top 20 entries with the highest local clustering coefficient and a Page Rank below the 5% percentile. | +| [AnomalyDetectionProjectionStatistics.cypher](./domains/anomaly-detection/queries/AnomalyDetectionProjectionStatistics.cypher) | queries | Reads projection statistics | +| [AnomalyDetectionSilentCoordinators.cypher](./domains/anomaly-detection/queries/AnomalyDetectionSilentCoordinators.cypher) | queries | Anomaly Detection Query: Find silent coordinators by listing the (at most) top 20 entries with the highest betweeenness >= 90% percentile and a in-degree <= 10% percentile. Shows code that controls lots of interactions, yet not many modules depend on it — hidden complexity | +| [AnomalyDetectionUnexpectedCentralNodes.cypher](./domains/anomaly-detection/queries/AnomalyDetectionUnexpectedCentralNodes.cypher) | queries | Anomaly Detection Query: Find hidden bottlenecks or hubs by listing the (at most) top 20 entries with the highest betweeenness >= 90% percentile and a degree <= 10% percentile. Shows code with high structural importance and only a few incoming and outgoing dependencies — often unexpected. | +| [AnomalyDetectionReset-Algorithms.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-Algorithms.cypher) | reset | Reset all algorithm features related to anomaly detection for code units to force a recalculation | +| [AnomalyDetectionReset-Anomalies.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-Anomalies.cypher) | reset | Reset all results related to anomaly detection for code units to force a clean recalculation | +| [AnomalyDetectionReset-Clustering.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-Clustering.cypher) | reset | Reset all clustering results related to anomaly detection for code units to force a clean recalculation | +| [AnomalyDetectionReset-Embeddings.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-Embeddings.cypher) | reset | Reset all embeddings related to anomaly detection for code units to force a clean recalculation | +| [AnomalyDetectionReset-StronglyConnectedComponents.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-StronglyConnectedComponents.cypher) | reset | Reset all StronglyConnectedComponent nodes and their relationships | +| [AnomalyDetectionReset-WeaklyConnectedComponents.cypher](./domains/anomaly-detection/reset/AnomalyDetectionReset-WeaklyConnectedComponents.cypher) | reset | Reset all WeaklyConnectedComponent nodes and their relationships | +| [AnomaliesDeepDiveArchetypes.cypher](./domains/anomaly-detection/summary/AnomaliesDeepDiveArchetypes.cypher) | summary | Anomaly Detection Summary: Summarizes all labelled archetypes by their anomaly score including examples. Requires all other labels/*.cypher queries to run first. Variables: projection_language, projection_node_label | +| [AnomaliesDeepDiveOverview.cypher](./domains/anomaly-detection/summary/AnomaliesDeepDiveOverview.cypher) | summary | Anomaly Detection DeepDive: Overview of analyzed code units and the number of anomalies detected. Requires all other labels/*.cypher queries to run first. Variables: projection_language, projection_node_label | +| [AnomaliesInTotal.cypher](./domains/anomaly-detection/summary/AnomaliesInTotal.cypher) | summary | Anomaly Detection Summary: Overview of all analyzed code units in total. Requires all other labels/*.cypher queries to run first. Variables: projection_language, projection_node_label | +| [AnomaliesPerAbstractionLayer.cypher](./domains/anomaly-detection/summary/AnomaliesPerAbstractionLayer.cypher) | summary | Anomaly Detection Summary: Overview of analyzed code units and the number of anomalies detected. Requires all other labels/*.cypher queries to run first. Variables: projection_language, projection_node_label | +| [AnomalyDeepDiveTopAnomalies.cypher](./domains/anomaly-detection/summary/AnomalyDeepDiveTopAnomalies.cypher) | summary | Anomaly Detection Summary: Lists top anomalies (at most 20), the top 3 features that contributed to the decision and the archetype(s) classification (if available) they are assigned to. Requires all other labels/*.cypher queries to run first. Variables: projection_language, projection_node_label | +| [External_module_usage_overall_for_Typescript.cypher](./domains/external-dependencies/queries/External_module_usage_overall_for_Typescript.cypher) | queries | External Typescript module usage overall | +| [External_module_usage_per_internal_module_aggregated_for_Typescript.cypher](./domains/external-dependencies/queries/External_module_usage_per_internal_module_aggregated_for_Typescript.cypher) | queries | External Typescript module usage per internal module aggregated | +| [External_module_usage_per_internal_module_distribution_for_Typescript.cypher](./domains/external-dependencies/queries/External_module_usage_per_internal_module_distribution_for_Typescript.cypher) | queries | External Typescript module usage distribution for internal modules | +| [External_module_usage_per_internal_module_sorted_for_Typescript.cypher](./domains/external-dependencies/queries/External_module_usage_per_internal_module_sorted_for_Typescript.cypher) | queries | External Typescript module usage per internal module sorted by external usage descending | +| [External_module_usage_spread_for_Typescript.cypher](./domains/external-dependencies/queries/External_module_usage_spread_for_Typescript.cypher) | queries | External Typescript module usage spread | +| [External_namespace_usage_overall_for_Typescript.cypher](./domains/external-dependencies/queries/External_namespace_usage_overall_for_Typescript.cypher) | queries | External Typescript namespace usage overall | +| [External_namespace_usage_per_internal_module_sorted_for_Typescript.cypher](./domains/external-dependencies/queries/External_namespace_usage_per_internal_module_sorted_for_Typescript.cypher) | queries | External Typescript module usage per internal module sorted by external usage descending | +| [External_namespace_usage_spread_for_Typescript.cypher](./domains/external-dependencies/queries/External_namespace_usage_spread_for_Typescript.cypher) | queries | External Typescript namespace usage spread | +| [External_package_levels.cypher](./domains/external-dependencies/queries/External_package_levels.cypher) | queries | External package levels | +| [External_package_name_elements.cypher](./domains/external-dependencies/queries/External_package_name_elements.cypher) | queries | External package name elements | +| [External_package_usage_overall.cypher](./domains/external-dependencies/queries/External_package_usage_overall.cypher) | queries | External package usage overall | +| [External_package_usage_per_artifact_and_external_package.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_and_external_package.cypher) | queries | External package usage per artifact and external package. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_and_package_with_annotations.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_and_package_with_annotations.cypher) | queries | External package usage per artifact and package with external annotations. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_and_package.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_and_package.cypher) | queries | External package usage per artifact and package. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_distribution.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_distribution.cypher) | queries | External package usage per artifact distribution. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_package_aggregated.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_package_aggregated.cypher) | queries | External package usage per artifact package aggregated. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_sorted_top.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_sorted_top.cypher) | queries | External package usage per artifact top externals. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact_sorted.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact_sorted.cypher) | queries | External package usage per artifact sorted by external usage descending. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_artifact.cypher](./domains/external-dependencies/queries/External_package_usage_per_artifact.cypher) | queries | External package usage per artifact. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_internal_package_count.cypher](./domains/external-dependencies/queries/External_package_usage_per_internal_package_count.cypher) | queries | External package usage per internal package count. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_type_distribution_with_annotations.cypher](./domains/external-dependencies/queries/External_package_usage_per_type_distribution_with_annotations.cypher) | queries | External package usage per type distribution with external annotations. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_per_type.cypher](./domains/external-dependencies/queries/External_package_usage_per_type.cypher) | queries | External package usage per type. Requires "Add_file_name and_extension.cypher". | +| [External_package_usage_spread.cypher](./domains/external-dependencies/queries/External_package_usage_spread.cypher) | queries | External package usage spread. Requires "Add_file_name and_extension.cypher". | +| [External_second_level_package_usage_overall.cypher](./domains/external-dependencies/queries/External_second_level_package_usage_overall.cypher) | queries | External second level package usage overall | +| [External_second_level_package_usage_per_artifact_and_external_package.cypher](./domains/external-dependencies/queries/External_second_level_package_usage_per_artifact_and_external_package.cypher) | queries | External second level package usage per artifact and external package. Requires "Add_file_name and_extension.cypher". | +| [External_second_level_package_usage_spread.cypher](./domains/external-dependencies/queries/External_second_level_package_usage_spread.cypher) | queries | External second level package usage spread. Requires "Add_file_name and_extension.cypher". | +| [External_types_per_artifact_using_requires.cypher](./domains/external-dependencies/queries/External_types_per_artifact_using_requires.cypher) | queries | External types per artifact using requires. Requires "Add_file_name and_extension.cypher". | +| [Label_external_types_and_annotations.cypher](./domains/external-dependencies/queries/Label_external_types_and_annotations.cypher) | queries | Label external types and external annotations. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | +| [List_external_Java_types_used.cypher](./domains/external-dependencies/queries/List_external_Java_types_used.cypher) | queries | List external Java types used | +| [List_external_modules_resolved_to_internal_ones_for_Typescript.cypher](./domains/external-dependencies/queries/List_external_modules_resolved_to_internal_ones_for_Typescript.cypher) | queries | Statistics about how many ExternalModule nodes were found that match internal Module nodes | +| [Maven_POMs_and_their_declared_dependencies.cypher](./domains/external-dependencies/queries/Maven_POMs_and_their_declared_dependencies.cypher) | queries | Maven POMs and their declared dependencies | +| [Package_json_dependencies_by_package.cypher](./domains/external-dependencies/queries/Package_json_dependencies_by_package.cypher) | queries | List package.json dependencies by package | +| [Package_json_dependencies_combinations_with_versions.cypher](./domains/external-dependencies/queries/Package_json_dependencies_combinations_with_versions.cypher) | queries | List most used combination of 2 and 3 dependencies including version specifier | +| [Package_json_dependencies_combinations.cypher](./domains/external-dependencies/queries/Package_json_dependencies_combinations.cypher) | queries | List most used combination of 2 and 3 dependencies | +| [Package_json_dependencies_occurrence.cypher](./domains/external-dependencies/queries/Package_json_dependencies_occurrence.cypher) | queries | List package.json dependencies by the number they are used by all packages | +| [Remove_external_type_and_annotation_labels.cypher](./domains/external-dependencies/queries/Remove_external_type_and_annotation_labels.cypher) | queries | Remove external type and annotation labels | +| [Cyclic_Dependencies_between_Artifacts_as_unwinded_List.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_between_Artifacts_as_unwinded_List.cypher) | cyclic-dependencies | Cyclic Dependencies between Artifacts as unwinded List | +| [Cyclic_Dependencies_Breakdown_Backward_Only_for_Typescript.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_Breakdown_Backward_Only_for_Typescript.cypher) | cyclic-dependencies | Cyclic Dependencies Breakdown Backward-Only for Typescript | +| [Cyclic_Dependencies_Breakdown_Backward_Only.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_Breakdown_Backward_Only.cypher) | cyclic-dependencies | Cyclic Dependencies Breakdown Backward Only. Requires "Add_file_name and_extension.cypher". | +| [Cyclic_Dependencies_Breakdown_for_Typescript.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_Breakdown_for_Typescript.cypher) | cyclic-dependencies | Cyclic Dependencies Breakdown for Typescript | +| [Cyclic_Dependencies_Breakdown.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_Breakdown.cypher) | cyclic-dependencies | Cyclic Dependencies Breakdown. Requires "Add_file_name and_extension.cypher". | +| [Cyclic_Dependencies_for_Typescript.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies_for_Typescript.cypher) | cyclic-dependencies | Cyclic Dependencies as List for Typescript | +| [Cyclic_Dependencies.cypher](./domains/internal-dependencies/queries/cyclic-dependencies/Cyclic_Dependencies.cypher) | cyclic-dependencies | Cyclic Dependencies as List. Requires "Add_file_name and_extension.cypher". | +| [Annotated_code_elements.cypher](./domains/internal-dependencies/queries/exploration/Annotated_code_elements.cypher) | exploration | Annotated code elements overall by element type with some examples | +| [Artifacts_with_duplicate_packages.cypher](./domains/internal-dependencies/queries/exploration/Artifacts_with_duplicate_packages.cypher) | exploration | Artifacts with the same full qualified package name (duplicate packages). These can lead to confusion and provide access to package protected classes to another artifact that might not be intended. Requires "Add_file_name and_extension.cypher". | +| [Candidates_for_Interface_Segregation.cypher](./domains/internal-dependencies/queries/internal-dependencies/Candidates_for_Interface_Segregation.cypher) | internal-dependencies | Candidates for Interface Segregation Lists Java interfaces that declare many methods but where callers only use a small subset. These are candidates to be split into a smaller, more focused interface (ISP). Column descriptions: - fullQualifiedTypeName: FQN of the interface that may be too broad - declaredMethodCount: total public methods (declared + inherited from super-interfaces) - distinctCalledMethodCount: how many distinct methods callers actually invoke - usageRatio: distinctCalledMethodCount / declaredMethodCount (lower = stronger candidate) - callerCount: number of distinct caller types using only that subset - exampleCalledMethods: the actual method names callers are using | +| [Get_file_distance_as_shortest_contains_path_for_dependencies.cypher](./domains/internal-dependencies/queries/internal-dependencies/Get_file_distance_as_shortest_contains_path_for_dependencies.cypher) | internal-dependencies | Get file distance distribution for dependencies (intuitively the fewest number of change directory commands needed) | +| [How_many_classes_compared_to_all_existing_in_the_same_package_are_used_by_dependent_packages_across_different_artifacts.cypher](./domains/internal-dependencies/queries/internal-dependencies/How_many_classes_compared_to_all_existing_in_the_same_package_are_used_by_dependent_packages_across_different_artifacts.cypher) | internal-dependencies | How many classes compared to all existing in the same package are used by dependent packages across different artifacts. Requires "Add_file_name and_extension.cypher". | +| [How_many_elements_compared_to_all_existing_are_used_by_dependent_modules_for_Typescript.cypher](./domains/internal-dependencies/queries/internal-dependencies/How_many_elements_compared_to_all_existing_are_used_by_dependent_modules_for_Typescript.cypher) | internal-dependencies | How many elements compared to all existing are used by dependent Typescript modules? | +| [How_many_packages_compared_to_all_existing_are_used_by_dependent_artifacts.cypher](./domains/internal-dependencies/queries/internal-dependencies/How_many_packages_compared_to_all_existing_are_used_by_dependent_artifacts.cypher) | internal-dependencies | How many packages compared to all existing are used by dependent artifacts? Requires "Add_file_name and_extension.cypher". | +| [Inter_scan_and_project_dependencies_of_Typescript_modules.cypher](./domains/internal-dependencies/queries/internal-dependencies/Inter_scan_and_project_dependencies_of_Typescript_modules.cypher) | internal-dependencies | Inter scan/project higher-level module dependencies for manual exploration | +| [Java_Artifact_build_levels_for_graphviz.cypher](./domains/internal-dependencies/queries/internal-dependencies/Java_Artifact_build_levels_for_graphviz.cypher) | internal-dependencies | List of all Java Artifacts and their dependencies with build levels for GraphViz Visualization | +| [List_all_Java_artifacts.cypher](./domains/internal-dependencies/queries/internal-dependencies/List_all_Java_artifacts.cypher) | internal-dependencies | List all existing artifacts | +| [List_all_Typescript_modules.cypher](./domains/internal-dependencies/queries/internal-dependencies/List_all_Typescript_modules.cypher) | internal-dependencies | List all existing internal Typescript modules. Requires "Set_localRootPath_for_modules.cypher", "Set_number_of...commits.cypher". | +| [List_elements_that_are_used_by_many_different_modules_for_Typescript.cypher](./domains/internal-dependencies/queries/internal-dependencies/List_elements_that_are_used_by_many_different_modules_for_Typescript.cypher) | internal-dependencies | List elements that are used by many different modules | +| [List_types_that_are_used_by_many_different_packages.cypher](./domains/internal-dependencies/queries/internal-dependencies/List_types_that_are_used_by_many_different_packages.cypher) | internal-dependencies | List types that are used by many different packages | +| [NPM_Package_build_levels_for_graphviz.cypher](./domains/internal-dependencies/queries/internal-dependencies/NPM_Package_build_levels_for_graphviz.cypher) | internal-dependencies | List of all NPM packages and their dependencies with build levels for GraphViz Visualization | +| [Set_file_distance_as_shortest_contains_path_for_dependencies.cypher](./domains/internal-dependencies/queries/internal-dependencies/Set_file_distance_as_shortest_contains_path_for_dependencies.cypher) | internal-dependencies | Set file distance for dependencies as the shortest path of CONTAINS relationships (intuitively the fewest number of change directory commands needed) | +| [Typescript_Module_build_levels_for_graphviz.cypher](./domains/internal-dependencies/queries/internal-dependencies/Typescript_Module_build_levels_for_graphviz.cypher) | internal-dependencies | List of all Typescript modules and their dependencies with build levels for GraphViz Visualization | +| [Path_Finding_1_Create_Projection.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_1_Create_Projection.cypher) | path-finding | Path Finding 1 Create Projection | +| [Path_Finding_2_Estimate_Memory.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_2_Estimate_Memory.cypher) | path-finding | Path Finding 2 Estimate Memory | +| [Path_Finding_3_Depth_First_Search_Path.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_3_Depth_First_Search_Path.cypher) | path-finding | Path Finding 3 Depth First Search Path | +| [Path_Finding_4_Breadth_First_Search_Path.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_4_Breadth_First_Search_Path.cypher) | path-finding | Path Finding 4 Breadth First Search Path | +| [Path_Finding_5_All_pairs_shortest_path_distribution_overall.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_5_All_pairs_shortest_path_distribution_overall.cypher) | path-finding | Path Finding - All pairs shortest path algorithm - Stream - Overall | +| [Path_Finding_5_All_pairs_shortest_path_distribution_per_project.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_5_All_pairs_shortest_path_distribution_per_project.cypher) | path-finding | Path Finding - All pairs shortest path algorithm - Stream - Per project | +| [Path_Finding_5_All_pairs_shortest_path_examples.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_5_All_pairs_shortest_path_examples.cypher) | path-finding | Path Finding - All pairs shortest path algorithm - Stream - Longest paths as examples | +| [Path_Finding_6_Longest_paths_contributors_for_graphviz.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_6_Longest_paths_contributors_for_graphviz.cypher) | path-finding | Path Finding - Longest path - Stream - List all dependencies for nodes contributing to longest paths and highlight those paths in the Visualization with GraphViz. Recommended prerequisite: Topological_Sort_Write.cypher | +| [Path_Finding_6_Longest_paths_distribution_overall.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_6_Longest_paths_distribution_overall.cypher) | path-finding | Longest paths distribution | +| [Path_Finding_6_Longest_paths_distribution_per_project.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_6_Longest_paths_distribution_per_project.cypher) | path-finding | Longest paths distribution | +| [Path_Finding_6_Longest_paths_examples.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_6_Longest_paths_examples.cypher) | path-finding | Path Finding - Longest path - Stream - Max. paths as examples | +| [Path_Finding_6_Longest_paths_for_graphviz.cypher](./domains/internal-dependencies/queries/path-finding/Path_Finding_6_Longest_paths_for_graphviz.cypher) | path-finding | Path Finding - Longest path - Stream - Find the top 100 dependencies contributing to the longest paths for Visualization with GraphViz. Recommended prerequisite: Topological_Sort_Write.cypher | +| [Set_Parameters_NonDevNpmPackage.cypher](./domains/internal-dependencies/queries/path-finding/Set_Parameters_NonDevNpmPackage.cypher) | path-finding | Example on how to set the parameters for path finding in this case for NPM Packages | +| [Set_Parameters_Typescript_Module.cypher](./domains/internal-dependencies/queries/path-finding/Set_Parameters_Typescript_Module.cypher) | path-finding | Example on how to set the parameters for path finding in this case for TypeScript modules | +| [Set_Parameters.cypher](./domains/internal-dependencies/queries/path-finding/Set_Parameters.cypher) | path-finding | Example on how to set the parameters for path finding in this case for Packages and PageRank | +| [Set_Parameters.cypher](./domains/internal-dependencies/queries/topological-sort/Set_Parameters.cypher) | topological-sort | Example on how to set the parameters for topological sort in this case for Java Artifacts and Node Similarity | +| [Topological_Sort_Critical_Path_Length.cypher](./domains/internal-dependencies/queries/topological-sort/Topological_Sort_Critical_Path_Length.cypher) | topological-sort | Critical path lengths (max build level) per abstraction level after topological sort. The maxDistanceFromSource property is set by the Topological Sort algorithm. Level 0 = no dependencies (can be built first). Higher level = more transitive dependents above it. The maximum level equals the minimum number of sequential build steps even with full parallelism. Needs graph-data-science plugin version >= 2.5.0 | +| [Topological_Sort_Exists.cypher](./domains/internal-dependencies/queries/topological-sort/Topological_Sort_Exists.cypher) | topological-sort | Return the first node with a "maxDistanceFromSource" if it exists | +| [Topological_Sort_List.cypher](./domains/internal-dependencies/queries/topological-sort/Topological_Sort_List.cypher) | topological-sort | Topological Sort to list the properties topologicalSortIndex (e.g. build order) and maxDistanceFromSource (build level) for each code unit node. Needs graph-data-science plugin version >= 2.5.0 | +| [Topological_Sort_Query.cypher](./domains/internal-dependencies/queries/topological-sort/Topological_Sort_Query.cypher) | topological-sort | Topological Sort to query the properties topologicalSortIndex (e.g. build order) and maxDistanceFromSource (build level) for each code unit node in topologicalSortIndex order. Requires "Add_file_name and_extension.cypher". Needs graph-data-science plugin version >= 2.5.0 | +| [Topological_Sort_Write.cypher](./domains/internal-dependencies/queries/topological-sort/Topological_Sort_Write.cypher) | topological-sort | Topological Sort to write the properties topologicalSortIndex (e.g. build order) and maxDistanceFromSource (build level) into the graph. Needs graph-data-science plugin version >= 2.5.0 | diff --git a/ENVIRONMENT_VARIABLES.md b/ENVIRONMENT_VARIABLES.md new file mode 100644 index 000000000..8ac827d90 --- /dev/null +++ b/ENVIRONMENT_VARIABLES.md @@ -0,0 +1,69 @@ +# Environment Variables Reference + +This document serves as a reference for all environment variables that are supported by the script files. +It provides a table listing each environment variable, its default value and its corresponding description provided as a inline comment. +This file was generated with the script [appendEnvironmentVariables.sh](./scripts/documentation/appendEnvironmentVariables.sh) and [generateEnvironmentVariableReference.sh](./scripts/documentation/generateEnvironmentVariableReference.sh). + +Environment Variable Name | Default | Description +------------------------- | ------- | ----------- +REPORTS_DIRECTORY | reports | +SCRIPTS_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/../../scripts | Repository directory containing the shell scripts +ANOMALY_DETECTION_FEATURE_CYPHER_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/features | +ANOMALY_DETECTION_QUERY_CYPHER_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/queries | +ANOMALY_DETECTION_LABEL_CYPHER_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/labels | +ANOMALY_DETECTION_SUMMARY_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/summary | Contains everything (scripts, queries, templates) to create the Markdown summary report for anomaly detection +MARKDOWN_INCLUDES_DIRECTORY | includes | Subdirectory that contains Markdown files to be included by the Markdown template for the report. +ANOMALY_DETECTION_GRAPHS_DIR | ${ANOMALY_DETECTION_SCRIPT_DIR}/graphs | Contains everything (scripts, queries, templates) to create the Markdown summary report for anomaly detection +VISUALIZATION_SCRIPTS_DIR | ${SCRIPTS_DIR}/visualization | Repository directory containing the shell scripts for visualization +MARKDOWN_SCRIPTS_DIR | ${SCRIPTS_DIR}/markdown | +EXTERNAL_DEPENDENCIES_QUERY_CYPHER_DIR | ${EXTERNAL_DEPENDENCIES_SCRIPT_DIR}/queries | +EXTERNAL_DEPENDENCIES_SUMMARY_DIR | ${EXTERNAL_DEPENDENCIES_SCRIPT_DIR}/summary | Contains everything (scripts, queries, templates) to create the Markdown summary report for external dependencies +INTERNAL_DEPENDENCIES_SUMMARY_DIR | ${INTERNAL_DEPENDENCIES_SCRIPT_DIR}/summary | Contains everything (scripts, templates) to create the Markdown summary report +INTERNAL_DEPENDENCIES_GRAPHS_DIR | ${INTERNAL_DEPENDENCIES_SCRIPT_DIR}/graphs | Contains everything (scripts, queries) to create graph visualizations +NEO4J_EDITION | community | Choose "community" or "enterprise" +NEO4J_VERSION | 2026.01.4 | +DATA_DIRECTORY | $( pwd -P )/data | Path where Neo4j writes its data to (outside tools dir) +RUNTIME_DIRECTORY | $( pwd -P )/runtime | Path where Neo4j puts runtime data to (e.g. logs) (outside tools dir) +NEO4J_HTTP_PORT | 7474 | Neo4j HTTP API port for executing queries +NEO4J_HTTPS_PORT | 7473 | Neo4j HTTPS port for encrypted querying +NEO4J_BOLT_PORT | 7687 | Neo4j's own "Bolt Protocol" port +NEO4J_CONFIG_TEMPLATE | template-neo4j.conf | Name of the template file ("configuration" folder) for the Neo4j configuration. Defaults to "template-neo4j.conf". +TOOLS_DIRECTORY | tools | Tools directory name used to detect the analysis workspace +NEO4J_APOC_PLUGIN_VERSION | 2026.01.4 | Awesome Procedures On Cypher (APOC) Plugin version number. Version needs to be compatible to Neo4j and usually matches its version number. +NEO4J_APOC_PLUGIN_EDITION | core | Awesome Procedures On Cypher (APOC) for Neo4j Plugin Edition (Neo4j v4.4.x "all", Neo4j >= v5 "core") +NEO4J_APOC_PLUGIN_GITHUB | neo4j/apoc | Awesome Procedures On Cypher (APOC) for Neo4j Plugin GitHub User/Repository (Neo4j v4.4.x "neo4j-contrib/neo4j-apoc-procedures", Neo4j >= v5 "neo4j/apoc") +NEO4J_GDS_PLUGIN_VERSION | 2.27.0 | Graph Data Science (GDS) Plugin Version 2.4.x of is compatible with Neo4j 5.x +NEO4J_OPEN_GDS_PLUGIN_VERSION | 2.26.0 | Graph Data Science (GDS) Plugin Version 2.4.x of is compatible with Neo4j 5.x +NEO4J_GDS_PLUGIN_EDITION | open | Graph Data Science (GDS) Plugin Edition: "open" for OpenGDS, "full" for the full version with Neo4j license +ARTIFACTS_DIRECTORY | artifacts | +SOURCE_DIRECTORY | source | +PREPARE_CONDA_ENVIRONMENT | true | Wether to prepare a Python environment with Conda if needed (default, "true") or use an already prepared Conda environment ("false") +JUPYTER_NOTEBOOK_DIRECTORY | ${SCRIPTS_DIR}/../jupyter | Repository directory containing the Jupyter Notebooks +CONDA_ENVIRONMENT_FILE | ${JUPYTER_NOTEBOOK_DIRECTORY}/../conda-environment.yml | Conda (package manager for Python) environment file path +CODEGRAPH_CONDA_ENVIRONMENT | codegraph | Name of the conda environment to use for code graph analysis +USE_VIRTUAL_PYTHON_ENVIRONMENT_VENV | false | Use "venv" for virtual Python environments ("true") or use an already prepared (e.g. conda) environment (default, "false"). +PYTHON_ENVIRONMENT_FILE | ${ROOT_DIRECTORY}/requirements.txt | Pip (package manager for Python) environment file path +REPORTS_SCRIPTS_DIRECTORY | reports | Working directory containing the generated reports +REPORT_COMPILATIONS_SCRIPTS_DIRECTORY | compilations | Repository directory that contains scripts that execute selected report generation scripts +SETTINGS_PROFILE_SCRIPTS_DIRECTORY | profiles | Repository directory that contains scripts containing settings +LOG_GROUP_START | ::group:: | Prefix to start a log group. Defaults to GitHub Actions log group start command. +LOG_GROUP_END | ::endgroup:: | Prefix to end a log group. Defaults to GitHub Actions log group end command. +DOMAINS_DIRECTORY | ${SCRIPTS_DIR}/../domains | +ARTIFACTS_CHANGE_DETECTION_HASH_FILE | artifactsChangeDetectionHash.txt | !DEPRECATED! Use CHANGE_DETECTION_HASH_FILE. +CHANGE_DETECTION_HASH_FILE_PATH | ./${ARTIFACTS_DIRECTORY}/${CHANGE_DETECTION_HASH_FILE} | Default path of the file that contains the hash code of the file list for change detection. Can be overridden by a command line option. +ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION | | Enable PDF generation for Jupyter Notebooks if set to any non empty value like "true" or disable it with "" or "false". +JUPYTER_OUTPUT_FILE_POSTFIX | | e.g. "" (no postfix), ".nbconvert" or ".output" +REPORTS_SCRIPT_DIR | ${SCRIPTS_DIR}/reports | Repository directory containing the report scripts +NEO4J_HTTP_TRANSACTION_ENDPOINT | db/neo4j/tx/commit | Since Neo4j v5: "db//tx/commit", Neo4j v4: "db/data/transaction/commit" +IMPORT_DIRECTORY | import | +IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT | plugin | Select how to import git log data. Options: "none", "aggregated", "full" and "plugin". Default="plugin". +JQASSISTANT_CLI_VERSION | 2.9.0 | +JQASSISTANT_CLI_ARTIFACT | jqassistant-commandline-neo4jv5 | +JQASSISTANT_CONFIG_TEMPLATE | template-neo4jv5-jqassistant-continue-on-error.yaml | +programmingLanguage | Java | Set to default value "Java" if not set since it is optional +NEO4J_INITIAL_PASSWORD | | Neo4j login password that was set to replace the temporary initial password +DOMAINS_DIR | ${SCRIPTS_DIR}/../domains | Repository directory containing the domain scripts +TYPESCRIPT_SCAN_HEAP_MEMORY | 4096 | Heap memory in megabytes for Typescript scanning with (Node.js process). Defaults to 4096 MB. +JQASSISTANT_CLI_DOWNLOAD_URL | https://repo1.maven.org/maven2/com/buschmais/jqassistant/cli | Download URL for the jQAssistant CLI +JQASSISTANT_CLI_DISTRIBUTION | distribution.zip | Neo4j v5 & v4: "distribution.zip" +IGNORED_JARS_DIRECTORY | ./../ignored-jars | Directory to move the filtered out .jar files to diff --git a/README.md b/README.md index fc44a134a..949a24987 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ Curious? Explore the examples at [code-graph-analysis-examples](https://github.c - Anomaly detection powered by unsupervised machine learning and explainable AI - Graph structure visualization - Automated reference document generation -- Runtime and library independent automation using [shell scripts](./scripts/SCRIPTS.md) +- Runtime and library independent automation using [shell scripts](./SCRIPTS.md) - Tested on MacOS (zsh), Linux (bash) and Windows (Git Bash) -- Comprehensive list of [Cypher queries](./cypher/CYPHER.md) +- Comprehensive list of [Cypher queries](./CYPHER.md) - Example analysis for [AxonFramework](https://github.com/AxonFramework/AxonFramework) - Example analysis for [react-router](https://github.com/remix-run/react-router) @@ -194,16 +194,16 @@ The [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-an ## :gear: Script Reference -[SCRIPTS.md](./scripts/SCRIPTS.md) lists all shell scripts of this repository including their first comment line as a description. It can be generated as described in [Generate Script Reference](./COMMANDS.md#generate-script-reference). +[SCRIPTS.md](./SCRIPTS.md) lists all shell scripts of this repository including their first comment line as a description. It can be generated as described in [Generate Script Reference](./COMMANDS.md#generate-script-reference). ## :mag: Cypher Query Reference -[CYPHER.md](./cypher/CYPHER.md) lists all Cypher queries of this repository including their first comment line as a description. It can be generated as described in [Generate Cypher Reference](./COMMANDS.md#generate-cypher-reference). +[CYPHER.md](./CYPHER.md) lists all Cypher queries of this repository including their first comment line as a description. It can be generated as described in [Generate Cypher Reference](./COMMANDS.md#generate-cypher-reference). > [Cypher](https://neo4j.com/docs/getting-started/cypher-intro) is Neo4j’s graph query language that lets you retrieve data from the graph. ## :globe_with_meridians: Environment Variable Reference -[ENVIRONMENT_VARIABLES.md](./scripts/ENVIRONMENT_VARIABLES.md) contains all environment variables that are supported by the scripts including default values and description. It can be generated as described in [Generate Environment Variable Reference](./COMMANDS.md#generate-environment-variable-reference). +[ENVIRONMENT_VARIABLES.md](./ENVIRONMENT_VARIABLES.md) contains all environment variables that are supported by the scripts including default values and description. It can be generated as described in [Generate Environment Variable Reference](./COMMANDS.md#generate-environment-variable-reference). ## :closed_book: Change Log diff --git a/SCRIPTS.md b/SCRIPTS.md new file mode 100644 index 000000000..a025f72c1 --- /dev/null +++ b/SCRIPTS.md @@ -0,0 +1,120 @@ +# Scripts Reference + +This document serves as a reference for all scripts in the current directory and its subdirectories. +It provides a table listing each script file and its corresponding description found in the first comment line. +This file was generated with the script [generateScriptReference.sh](./scripts/documentation/generateScriptReference.sh). + +Script | Directory | Description +------ | --------- | ----------- +[anomalyDetectionCsv.sh](./domains/anomaly-detection/anomalyDetectionCsv.sh) | anomaly-detection | Pipeline that coordinates anomaly detection using the Graph Data Science Library of Neo4j. +[anomalyDetectionMarkdown.sh](./domains/anomaly-detection/anomalyDetectionMarkdown.sh) | anomaly-detection | This script is dynamically triggered by "MarkdownReports.sh" when report "All" or "Markdown" are enabled. +[anomalyDetectionPython.sh](./domains/anomaly-detection/anomalyDetectionPython.sh) | anomaly-detection | Pipeline that coordinates anomaly detection using the Graph Data Science Library of Neo4j. +[anomalyDetectionVisualization.sh](./domains/anomaly-detection/anomalyDetectionVisualization.sh) | anomaly-detection | This script is dynamically triggered by "VisualizationReports.sh" when report "All" or "Visualization" is enabled. +[renderArchitecture.sh](./domains/anomaly-detection/documentation/renderArchitecture.sh) | documentation | Renders the described Graph in Architecture.gv as a SVG image. +[anomalyDetectionGraphs.sh](./domains/anomaly-detection/graphs/anomalyDetectionGraphs.sh) | graphs | Executes selected anomaly detection Cypher queries for GraphViz visualization. +[anomalyDetectionSummary.sh](./domains/anomaly-detection/summary/anomalyDetectionSummary.sh) | summary | Creates a Markdown report that contains all results of all the anomaly detection methods. +[externalDependenciesCsv.sh](./domains/external-dependencies/externalDependenciesCsv.sh) | external-dependencies | Executes Cypher queries to generate external dependency CSV reports. +[externalDependenciesMarkdown.sh](./domains/external-dependencies/externalDependenciesMarkdown.sh) | external-dependencies | This script is dynamically triggered by "MarkdownReports.sh" when report "All" or "Markdown" are enabled. +[externalDependenciesPython.sh](./domains/external-dependencies/externalDependenciesPython.sh) | external-dependencies | Generates external dependency charts as SVG files using Python. +[externalDependenciesSummary.sh](./domains/external-dependencies/summary/externalDependenciesSummary.sh) | summary | Creates a Markdown report summarising all external dependency analysis results. +[internalDependenciesGraphs.sh](./domains/internal-dependencies/graphs/internalDependenciesGraphs.sh) | graphs | Executes internal dependency and path finding Cypher queries for GraphViz visualization. +[internalDependenciesCsv.sh](./domains/internal-dependencies/internalDependenciesCsv.sh) | internal-dependencies | Pipeline that coordinates internal dependency analysis using Cypher queries and the +[internalDependenciesMarkdown.sh](./domains/internal-dependencies/internalDependenciesMarkdown.sh) | internal-dependencies | This script is dynamically triggered by "MarkdownReports.sh" when report "All" or "Markdown" are enabled. +[internalDependenciesPython.sh](./domains/internal-dependencies/internalDependenciesPython.sh) | internal-dependencies | Generates path finding charts as SVG files using Python. +[internalDependenciesVisualization.sh](./domains/internal-dependencies/internalDependenciesVisualization.sh) | internal-dependencies | This script is dynamically triggered by "VisualizationReports.sh" when report "All" or "Visualization" is enabled. +[internalDependenciesSummary.sh](./domains/internal-dependencies/summary/internalDependenciesSummary.sh) | summary | Creates a Markdown report summarising all internal dependency analysis results. +[configureNeo4j.sh](./domains/neo4j-management/configureNeo4j.sh) | neo4j-management | Configures a (local) Neo4j Community Edition Graph Database (https://neo4j.com/download-center/#community). +[detectNeo4j.sh](./domains/neo4j-management/detectNeo4j.sh) | neo4j-management | Detects if Neo4j is running and outputs its installation directory. +[detectNeo4jWindows.sh](./domains/neo4j-management/detectNeo4jWindows.sh) | neo4j-management | Detects if Neo4j is running on Windows from WSL or Git Bash. +[setupNeo4j.sh](./domains/neo4j-management/setupNeo4j.sh) | neo4j-management | Installs (download, unpack, get plugins, configure) a local Neo4j Graph Database (https://neo4j.com/download-center/#community). +[setupNeo4jInitialPassword.sh](./domains/neo4j-management/setupNeo4jInitialPassword.sh) | neo4j-management | Sets the initial password for the local Neo4j Graph Database (https://neo4j.com/download-center/#community). +[startNeo4j.sh](./domains/neo4j-management/startNeo4j.sh) | neo4j-management | Starts the local Neo4j Graph Database. +[stopNeo4j.sh](./domains/neo4j-management/stopNeo4j.sh) | neo4j-management | Stops the local Neo4j Graph Database. +[testConfigureNeo4j.sh](./domains/neo4j-management/testConfigureNeo4j.sh) | neo4j-management | Tests "configureNeo4j.sh". +[useNeo4jHighMemoryProfile.sh](./domains/neo4j-management/useNeo4jHighMemoryProfile.sh) | neo4j-management | Use the high memory profile and apply its configuration template on the local +[waitForNeo4jHttpFunctions.sh](./domains/neo4j-management/waitForNeo4jHttpFunctions.sh) | neo4j-management | Waits until the HTTP Transactions API of Neo4j Graph Database is available. +[init.sh](./init.sh) | | Initializes a new analysis project by creating all necessary directories based on the given input parameter with the analysis name. +[activateCondaEnvironment.sh](./scripts/activateCondaEnvironment.sh) | scripts | Activates the Conda (Python package manager) environment "codegraph" with all packages needed to run the included Jupyter Notebooks and Python scripts. +[activatePythonEnvironment.sh](./scripts/activatePythonEnvironment.sh) | scripts | Activates the .venv environment (Python build-in virtual environments) with all packages necessary to run the included Jupyter Notebooks and Python scripts. +[analyze.sh](./scripts/analysis/analyze.sh) | analysis | Coordinates the end-to-end analysis process, encompassing tool installation, graph generation, and report generation. +[checkCompatibility.sh](./scripts/checkCompatibility.sh) | scripts | Check environment dependencies and tool availability. +[cleanupAfterReportGeneration.sh](./scripts/cleanupAfterReportGeneration.sh) | scripts | Cleans up after report generation. This includes deleting empty files or in case no file is left deleting the report folder. +[cloneGitRepository.sh](./scripts/cloneGitRepository.sh) | scripts | Provides safe-guarded (security checked parameters) git repository cloning. +[createAggregatedGitLogCsv.sh](./scripts/createAggregatedGitLogCsv.sh) | scripts | Uses git log to create a comma separated values (CSV) file containing aggregated changes, their author name and email address, year and month for all the files that were changed. +[createGitLogCsv.sh](./scripts/createGitLogCsv.sh) | scripts | Uses git log to create a comma separated values (CSV) file containing all commits, their author, email address, date and all the file names that were changed with it. +[detectChangedFiles.sh](./scripts/detectChangedFiles.sh) | scripts | Detect changed files in the artifacts directory or in a given list of paths +[appendEnvironmentVariables.sh](./scripts/documentation/appendEnvironmentVariables.sh) | documentation | Extracts the environment variable declarations including default values from a script file and appends it to a markdown file as table columns. +[generateCypherReference.sh](./scripts/documentation/generateCypherReference.sh) | documentation | Generates "CYPHER.md" containing a reference to all Cypher files in this directory and its subdirectories. +[generateEnvironmentVariableReference.sh](./scripts/documentation/generateEnvironmentVariableReference.sh) | documentation | Runs "appendEnvironmentVariables.sh" for every script file in all directories and subdirectories. +[generateScriptReference.sh](./scripts/documentation/generateScriptReference.sh) | documentation | Generates "SCRIPTS.md" containing a reference to all scripts in all directories and subdirectories. +[download.sh](./scripts/download.sh) | scripts | Downloads a file into the directory of the environment variable SHARED_DOWNLOADS_DIRECTORY (or default "../downloads"). +[downloadAntDesign.sh](./scripts/downloader/downloadAntDesign.sh) | downloader | Downloads the Typescript project ant-design (https://github.com/ant-design/ant-design) from GitHub using git clone. +[downloadAxonFramework.sh](./scripts/downloader/downloadAxonFramework.sh) | downloader | Downloads AxonFramework (https://developer.axoniq.io/axon-framework) artifacts from Maven Central. +[downloadReactRouter.sh](./scripts/downloader/downloadReactRouter.sh) | downloader | Downloads react-router (https://github.com/remix-run/react-router) from GitHub using git clone. +[downloadTypescriptProject.sh](./scripts/downloader/downloadTypescriptProject.sh) | downloader | Downloads the given version of a Typescript project from a git repository using git clone. +[downloadMavenArtifact.sh](./scripts/downloadMavenArtifact.sh) | scripts | Downloads an artifact from Maven Central (https://mvnrepository.com/repos/central) +[downloadMavenArtifacts.sh](./scripts/downloadMavenArtifacts.sh) | scripts | Uses Maven to download specified Maven artifacts from Maven Central. +[analyzeAntDesign.sh](./scripts/examples/analyzeAntDesign.sh) | examples | This is an example for the analysis of a the Typescript project "ant-design". +[analyzeAxonFramework.sh](./scripts/examples/analyzeAxonFramework.sh) | examples | This is an example for the analysis of the Java event-sourcing library "AxonFramework". +[analyzeReactRouter.sh](./scripts/examples/analyzeReactRouter.sh) | examples | This is an example for the analysis of a the Typescript project "react-router". +[detectLatestGitTag.sh](./scripts/examples/detectLatestGitTag.sh) | examples | Returns the latest tag of a remote repository given by its url. +[executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh) | scripts | Executes all steps in the given Jupyter Notebook (ipynb), stores it and converts it to Markdown (md) and PDF. +[executeJupyterNotebookReport.sh](./scripts/executeJupyterNotebookReport.sh) | scripts | Executes the given Jupyter Notebook and puts all resulting files (ipynb, md, pdf) into an accordingly named directory within the "results" directory. +[executeQuery.sh](./scripts/executeQuery.sh) | scripts | Utilizes Neo4j's HTTP API to execute a Cypher query from an input file and provides the results in CSV format. +[executeQueryFunctions.sh](./scripts/executeQueryFunctions.sh) | scripts | Provides functions to execute Cypher queries using either "executeQuery.sh" or Neo4j's "cypher-shell". +[findPathsToScan.sh](./scripts/findPathsToScan.sh) | scripts | Finds all files and directories to scan and analyze and provides them as comma-separated list. +[importGit.sh](./scripts/importGit.sh) | scripts | Coordinates the import of git data from the given --source directory where one ore more git repositories are located and the value of the environment variable IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT. +[installJavaScriptDependencies.sh](./scripts/installJavaScriptDependencies.sh) | scripts | This script triggers the installation of dependencies for JavaScript projects in the source folder. +[embedMarkdownIncludes.sh](./scripts/markdown/embedMarkdownIncludes.sh) | markdown | Processes template markdown (sysin) replacing placeholders like "" or "" with the contents of the specified markdown files. The files to include needs to be in the "includes" subdirectory. +[formatQueryResultAsMarkdownTable.sh](./scripts/markdown/formatQueryResultAsMarkdownTable.sh) | markdown | Takes the input stream (Cypher query result in JSON format) and formats it as a Markdown table. +[testEmbedMarkdownIncludes.sh](./scripts/markdown/testEmbedMarkdownIncludes.sh) | markdown | Tests template processing for markdown by embedding includes. +[testFormatQueryResultAsMarkdownTable.sh](./scripts/markdown/testFormatQueryResultAsMarkdownTable.sh) | markdown | Tests formatting of Cypher query results as Markdown table. +[operatingSystemFunctions.sh](./scripts/operatingSystemFunctions.sh) | scripts | Provides operating system dependent functions e.g. to detect Windows. +[parseCsvFunctions.sh](./scripts/parseCsvFunctions.sh) | scripts | Provides functions to parse strings in CSV format. +[prepareAnalysis.sh](./scripts/prepareAnalysis.sh) | scripts | Prepares and validates the graph database before analysis +[Default.sh](./scripts/profiles/Default.sh) | profiles | Sets (if any) settings variables for a default analysis. +[Neo4j-latest-continue-on-scan-errors.sh](./scripts/profiles/Neo4j-latest-continue-on-scan-errors.sh) | profiles | Sets all settings variables for an analysis with the latest version of Neo4j. +[Neo4j-latest-high-memory.sh](./scripts/profiles/Neo4j-latest-high-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). +[Neo4j-latest-low-memory-continue-on-scan-errors.sh](./scripts/profiles/Neo4j-latest-low-memory-continue-on-scan-errors.sh) | profiles | Sets all settings variables for a low memory, continue-on-error analysis with the latest version of Neo4j. +[Neo4j-latest-low-memory.sh](./scripts/profiles/Neo4j-latest-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). +[Neo4j-latest.sh](./scripts/profiles/Neo4j-latest.sh) | profiles | Sets all settings variables for an analysis with the latest version of Neo4j. +[Neo4jv4-low-memory.sh](./scripts/profiles/Neo4jv4-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v4.4.x (long term support (LTS) version as of may 2023). +[Neo4jv4.sh](./scripts/profiles/Neo4jv4.sh) | profiles | Sets all settings variables for an analysis with Neo4j v4.4.x (long term support (LTS) version as of may 2023). +[Neo4jv5-continue-on-scan-errors.sh](./scripts/profiles/Neo4jv5-continue-on-scan-errors.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). +[Neo4jv5-low-memory.sh](./scripts/profiles/Neo4jv5-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). +[Neo4jv5.sh](./scripts/profiles/Neo4jv5.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). +[projectionFunctions.sh](./scripts/projectionFunctions.sh) | scripts | Provides functions to create and delete Graph Projections for Neo4j Graph Data Science. +[ArtifactDependenciesCsv.sh](./scripts/reports/ArtifactDependenciesCsv.sh) | reports | Executes "Artifact_Dependencies" Cypher queries to get the "artifact-dependencies-csv" CSV reports. +[CentralityCsv.sh](./scripts/reports/CentralityCsv.sh) | reports | Looks for centrality using the Graph Data Science Library of Neo4j and creates CSV reports. +[CommunityCsv.sh](./scripts/reports/CommunityCsv.sh) | reports | Detects communities using the Graph Data Science Library of Neo4j and creates CSV reports. +[AllReports.sh](./scripts/reports/compilations/AllReports.sh) | compilations | Runs all report scripts. +[CsvReports.sh](./scripts/reports/compilations/CsvReports.sh) | compilations | Runs all CSV report scripts (no Python and Chromium required). +[DatabaseCsvExportReports.sh](./scripts/reports/compilations/DatabaseCsvExportReports.sh) | compilations | Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all" +[JupyterReports.sh](./scripts/reports/compilations/JupyterReports.sh) | compilations | Runs all Jupyter Notebook report scripts. +[MarkdownReports.sh](./scripts/reports/compilations/MarkdownReports.sh) | compilations | Runs all Markdown report scripts (no Chromium required, no Python required). +[PythonReports.sh](./scripts/reports/compilations/PythonReports.sh) | compilations | Runs all Python report scripts (no Chromium required). +[VisualizationReports.sh](./scripts/reports/compilations/VisualizationReports.sh) | compilations | Runs all Visualization reports. +[GitHistoryCsv.sh](./scripts/reports/GitHistoryCsv.sh) | reports | Executes "GitLog" Cypher queries to get the "git-history-csv" CSV reports. +[JavaCsv.sh](./scripts/reports/JavaCsv.sh) | reports | Executes "Java" Cypher queries to get the "java-csv" CSV reports. +[NodeEmbeddingsCsv.sh](./scripts/reports/NodeEmbeddingsCsv.sh) | reports | Generates node embeddings using the Graph Data Science Library of Neo4j and creates CSV reports. +[ObjectOrientedDesignMetricsCsv.sh](./scripts/reports/ObjectOrientedDesignMetricsCsv.sh) | reports | Executes "Metrics" Cypher queries to get the "object-oriented-design-metrics-csv" CSV reports. +[OverviewCsv.sh](./scripts/reports/OverviewCsv.sh) | reports | Executes "Overview" Cypher queries to get the "overview-csv" CSV reports. +[SimilarityCsv.sh](./scripts/reports/SimilarityCsv.sh) | reports | Looks for similarity using the Graph Data Science Library of Neo4j and creates CSV reports. +[VisibilityMetricsCsv.sh](./scripts/reports/VisibilityMetricsCsv.sh) | reports | Executes "Visibility" Cypher queries to get the "visibility-metrics-csv" CSV reports. +[resetAndScan.sh](./scripts/resetAndScan.sh) | scripts | Deletes all data in the Neo4j graph database and rescans the downloaded artifacts to create a new graph. +[resetAndScanChanged.sh](./scripts/resetAndScanChanged.sh) | scripts | Executes "resetAndScan.sh" only if "detectChangedFiles.sh" returns detected changes. +[runTests.sh](./scripts/runTests.sh) | scripts | Runs all test scripts (no Python and Chromium required). +[scanTypescript.sh](./scripts/scanTypescript.sh) | scripts | Executes the npm package @jqassistant/ts-lc using npx to scan the Typescript projects in the source directory and create an intermediate json data file for the jQAssistant Typescript plugin. +[setupJQAssistant.sh](./scripts/setupJQAssistant.sh) | scripts | Installs (download and unzip) jQAssistant (https://jqassistant.github.io/jqassistant/current). +[sortOutExternalJavaJarFiles.sh](./scripts/sortOutExternalJavaJarFiles.sh) | scripts | Sorts out jar files that don't contain one of the given package names (e.g. external libraries) and moves them into the IGNORED_JARS_DIRECTORY. +[startNeo4j.sh](./scripts/startNeo4j.sh) | scripts | Deprecated: startNeo4j.sh has been moved to domains/neo4j-management/. +[stopNeo4j.sh](./scripts/stopNeo4j.sh) | scripts | Deprecated: stopNeo4j.sh has been moved to domains/neo4j-management/. +[testAnalyzeDomainOption.sh](./scripts/testAnalyzeDomainOption.sh) | scripts | Tests "--domain" command line option of "analyze.sh". +[testCloneGitRepository.sh](./scripts/testCloneGitRepository.sh) | scripts | Tests "cloneGitRepository.sh". +[testDetectChangedFiles.sh](./scripts/testDetectChangedFiles.sh) | scripts | Tests "detectChangedFiles.sh". +[testDownloadMavenArtifacts.sh](./scripts/testDownloadMavenArtifacts.sh) | scripts | Tests "downloadMavenArtifacts.sh". +[testFilenameReferences.sh](./scripts/testFilenameReferences.sh) | scripts | Tests: scan all *.sh files (current directory including subdirectories) +[testInstallJavaScriptDependencies.sh](./scripts/testInstallJavaScriptDependencies.sh) | scripts | Tests "installJavaScriptDependencies.sh". +[convertQueryResultCsvToGraphVizDotFile.sh](./scripts/visualization/convertQueryResultCsvToGraphVizDotFile.sh) | visualization | Converts a Cypher query result in CSV format to a GraphViz DOT (https://graphviz.org/doc/info/lang.html) file for Visualization including layout templates. +[renderGraphVizSVG.sh](./scripts/visualization/renderGraphVizSVG.sh) | visualization | Renders the given GraphViz file as a SVG image. +[visualizeQueryResults.sh](./scripts/visualization/visualizeQueryResults.sh) | visualization | Visualizes the Cypher query result (CSV format) using GraphViz and outputs it as SVG image. diff --git a/cypher/CYPHER.md b/cypher/CYPHER.md deleted file mode 100644 index 5517e531e..000000000 --- a/cypher/CYPHER.md +++ /dev/null @@ -1,369 +0,0 @@ -# Cypher Reference - -This document serves as a reference for all Cypher files in the current directory and its subdirectories. -It provides a table listing each Cypher file and its corresponding description found in the first comment line. -This file was generated with the script [generateCypherReference.sh](./../scripts/documentation/generateCypherReference.sh). - -Script | Directory | Description --------|-----------|------------ -| [Artifacts_with_dependencies_to_other_artifacts.cypher](./Artifact_Dependencies/Artifacts_with_dependencies_to_other_artifacts.cypher) | Artifact_Dependencies | Artifacts with dependencies to other artifacts. Requires "Add_file_name and_extension.cypher". | -| [Artifacts_with_duplicate_packages.cypher](./Artifact_Dependencies/Artifacts_with_duplicate_packages.cypher) | Artifact_Dependencies | Artifacts with the same full qualified package name (duplicate packages). These can lead to confusion and provide access to package protected classes to another artifact that might not be intended. Requires "Add_file_name and_extension.cypher". | -| [Incoming_Java_Artifact_Dependencies.cypher](./Artifact_Dependencies/Incoming_Java_Artifact_Dependencies.cypher) | Artifact_Dependencies | Incoming Artifact Dependencies | -| [Most_used_internal_dependencies_acreoss_artifacts.cypher](./Artifact_Dependencies/Most_used_internal_dependencies_acreoss_artifacts.cypher) | Artifact_Dependencies | Most used internal dependencies across artifacts. Requires "Add_file_name and_extension.cypher". | -| [Outgoing_Java_Artifact_Dependencies.cypher](./Artifact_Dependencies/Outgoing_Java_Artifact_Dependencies.cypher) | Artifact_Dependencies | Outgoing Artifact Dependencies | -| [Set_maven_artifact_version.cypher](./Artifact_Dependencies/Set_maven_artifact_version.cypher) | Artifact_Dependencies | Set property "version" on Artifact nodes to what is specified in the Maven POM | -| [Set_number_of_Java_packages_and_types_on_artifacts.cypher](./Artifact_Dependencies/Set_number_of_Java_packages_and_types_on_artifacts.cypher) | Artifact_Dependencies | Set number of Java packages and types on artifacts | -| [Usage_and_spread_of_internal_artifact_dependencies.cypher](./Artifact_Dependencies/Usage_and_spread_of_internal_artifact_dependencies.cypher) | Artifact_Dependencies | Usage and spread of internal artifact dependencies. Requires "Add_file_name and_extension.cypher". | -| [Usage_and_spread_of_internal_artifact_dependents.cypher](./Artifact_Dependencies/Usage_and_spread_of_internal_artifact_dependents.cypher) | Artifact_Dependencies | Usage and spread of internal artifact dependents. Requires "Add_file_name and_extension.cypher". | -| [Centrality_10a_Bridges_Estimate.cypher](./Centrality/Centrality_10a_Bridges_Estimate.cypher) | Centrality | Centrality 10a Bridges Estimate | -| [Centrality_10d_Bridges_Stream.cypher](./Centrality/Centrality_10d_Bridges_Stream.cypher) | Centrality | Centrality 10d Bridges Stream | -| [Centrality_10e_Bridges_Write.cypher](./Centrality/Centrality_10e_Bridges_Write.cypher) | Centrality | Centrality 10e Bridges Stream - Write Relationship Property "isBridge" | -| [Centrality_1a_List_TopPercentile.cypher](./Centrality/Centrality_1a_List_TopPercentile.cypher) | Centrality | List the top centrality nodes with a 99.5 percentile or higher | -| [Centrality_1b_List_TopPercent.cypher](./Centrality/Centrality_1b_List_TopPercent.cypher) | Centrality | List the top 2% nodes with the highest centrality score. | -| [Centrality_1c_Label_Delete.cypher](./Centrality/Centrality_1c_Label_Delete.cypher) | Centrality | Centrality Label Delete | -| [Centrality_1d_Label_Add.cypher](./Centrality/Centrality_1d_Label_Add.cypher) | Centrality | Centrality Add label to the top 2% nodes with the highest centrality score | -| [Centrality_2a_Page_Rank_Estimate.cypher](./Centrality/Centrality_2a_Page_Rank_Estimate.cypher) | Centrality | Centrality 2a Page Rank Estimate Memory | -| [Centrality_2b_Page_Rank_Statistics.cypher](./Centrality/Centrality_2b_Page_Rank_Statistics.cypher) | Centrality | Centrality 2b Page Rank Statistics | -| [Centrality_3c_Page_Rank_Mutate.cypher](./Centrality/Centrality_3c_Page_Rank_Mutate.cypher) | Centrality | Centrality 3c Page Rank Mutate | -| [Centrality_3d_Page_Rank_Stream.cypher](./Centrality/Centrality_3d_Page_Rank_Stream.cypher) | Centrality | Centrality 3d Page Rank Stream | -| [Centrality_3e_Page_Rank_Write.cypher](./Centrality/Centrality_3e_Page_Rank_Write.cypher) | Centrality | Centrality 3e Page Rank Write | -| [Centrality_4a_Article_Rank_Estimate.cypher](./Centrality/Centrality_4a_Article_Rank_Estimate.cypher) | Centrality | Centrality 4a Article Rank Estimate Memory | -| [Centrality_4b_Article_Rank_Statistics.cypher](./Centrality/Centrality_4b_Article_Rank_Statistics.cypher) | Centrality | Centrality 4b Article Rank Statistics | -| [Centrality_4c_Article_Rank_Mutate.cypher](./Centrality/Centrality_4c_Article_Rank_Mutate.cypher) | Centrality | Centrality 4c Article Rank Mutate | -| [Centrality_4d_Article_Rank_Stream.cypher](./Centrality/Centrality_4d_Article_Rank_Stream.cypher) | Centrality | Centrality 4d Article Rank Stream | -| [Centrality_4e_Article_Rank_Write.cypher](./Centrality/Centrality_4e_Article_Rank_Write.cypher) | Centrality | Centrality 4e Article Rank Write | -| [Centrality_5a_Betweeness_Estimate.cypher](./Centrality/Centrality_5a_Betweeness_Estimate.cypher) | Centrality | Centrality 5a Betweeness Estimate | -| [Centrality_5b_Betweeness_Statistics.cypher](./Centrality/Centrality_5b_Betweeness_Statistics.cypher) | Centrality | Centrality 5b Betweeness Statistics | -| [Centrality_5c_Betweeness_Mutate.cypher](./Centrality/Centrality_5c_Betweeness_Mutate.cypher) | Centrality | Centrality 5c Betweeness Mutate | -| [Centrality_5d_Betweeness_Stream.cypher](./Centrality/Centrality_5d_Betweeness_Stream.cypher) | Centrality | Centrality 5d Betweeness Stream | -| [Centrality_5e_Betweeness_Write.cypher](./Centrality/Centrality_5e_Betweeness_Write.cypher) | Centrality | Centrality 5e Betweeness Write | -| [Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher](./Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher) | Centrality | Centrality 6a Cost-effective Lazy Forward (CELF) Estimate | -| [Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher](./Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher) | Centrality | Centrality 6b Cost-effective Lazy Forward (CELF) Statistics | -| [Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher](./Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher) | Centrality | Centrality 6c Cost-effective Lazy Forward (CELF) Mutate | -| [Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher](./Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher) | Centrality | Centrality 6d Cost-effective Lazy Forward (CELF) Stream | -| [Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher](./Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher) | Centrality | Centrality 6e Cost-effective Lazy Forward (CELF) Write | -| [Centrality_7b_Harmonic_Closeness_Statistics.cypher](./Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher) | Centrality | Centrality 7b Harmonic Closeness Statistics | -| [Centrality_7c_Harmonic_Closeness_Mutate.cypher](./Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher) | Centrality | Centrality 7c Harmonic Closeness Mutate | -| [Centrality_7d_Harmonic_Closeness_Stream.cypher](./Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher) | Centrality | Centrality 7a Harmonic Closeness Stream | -| [Centrality_7e_Harmonic_Closeness_Write.cypher](./Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher) | Centrality | Centrality 7d Harmonic Closeness Write | -| [Centrality_8b_Closeness_Statistics.cypher](./Centrality/Centrality_8b_Closeness_Statistics.cypher) | Centrality | Centrality 8b Closeness Statistics | -| [Centrality_8c_Closeness_Mutate.cypher](./Centrality/Centrality_8c_Closeness_Mutate.cypher) | Centrality | Centrality 8c Closeness Mutate | -| [Centrality_8d_Closeness_Stream.cypher](./Centrality/Centrality_8d_Closeness_Stream.cypher) | Centrality | Centrality 8c Closeness Stream | -| [Centrality_8e_Closeness_Write.cypher](./Centrality/Centrality_8e_Closeness_Write.cypher) | Centrality | Centrality 8d Closeness Write | -| [Centrality_90_Summary.cypher](./Centrality/Centrality_90_Summary.cypher) | Centrality | Centrality Summary. Requires "Add_file_name and_extension.cypher". | -| [Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher](./Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher) | Centrality | Centrality 9a Hyperlink-Induced Topic Search (HITS) Memory Estimation | -| [Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher](./Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher) | Centrality | Centrality 9b Hyperlink-Induced Topic Search (HITS) Statistics | -| [Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher](./Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher) | Centrality | Centrality 9c Hyperlink-Induced Topic Search (HITS) Mutate | -| [Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher](./Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher) | Centrality | Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream | -| [Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher](./Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher) | Centrality | Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream Mutated. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | -| [Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher](./Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher) | Centrality | Centrality 9e Hyperlink-Induced Topic Search (HITS) Write | -| [Set_Parameters.cypher](./Centrality/Set_Parameters.cypher) | Centrality | Example on how to set the parameters for centrality in this case for Packages and PageRank | -| [Community_Detection_10a_LocalClusteringCoefficient_Estimate.cypher](./Community_Detection/Community_Detection_10a_LocalClusteringCoefficient_Estimate.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Estimate | -| [Community_Detection_10b_LocalClusteringCoefficient_Statistics.cypher](./Community_Detection/Community_Detection_10b_LocalClusteringCoefficient_Statistics.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Statistics | -| [Community_Detection_10c_LocalClusteringCoefficient_Mutate.cypher](./Community_Detection/Community_Detection_10c_LocalClusteringCoefficient_Mutate.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Mutate | -| [Community_Detection_10d_LocalClusteringCoefficient_Stream.cypher](./Community_Detection/Community_Detection_10d_LocalClusteringCoefficient_Stream.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Stream | -| [Community_Detection_10d_LocalClusteringCoefficient_Stream_Aggregated.cypher](./Community_Detection/Community_Detection_10d_LocalClusteringCoefficient_Stream_Aggregated.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Stream Aggregated | -| [Community_Detection_10e_LocalClusteringCoefficient_Write.cypher](./Community_Detection/Community_Detection_10e_LocalClusteringCoefficient_Write.cypher) | Community_Detection | Community Detection - Local Clustering Coefficient - Write | -| [Community_Detection_11a_HDBSCAN_Estimate.cypher](./Community_Detection/Community_Detection_11a_HDBSCAN_Estimate.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Estimate | -| [Community_Detection_11b_HDBSCAN_Statistics.cypher](./Community_Detection/Community_Detection_11b_HDBSCAN_Statistics.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Statistics | -| [Community_Detection_11c_HDBSCAN_Mutate.cypher](./Community_Detection/Community_Detection_11c_HDBSCAN_Mutate.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Mutate | -| [Community_Detection_11d_HDBSCAN_Stream.cypher](./Community_Detection/Community_Detection_11d_HDBSCAN_Stream.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - Stream | -| [Community_Detection_11e_HDBSCAN_Write.cypher](./Community_Detection/Community_Detection_11e_HDBSCAN_Write.cypher) | Community_Detection | Community Detection: Hierarchical Density-Based Spatial Clustering (HDBSCAN) - write node property e.g. communityHdbscanLabel | -| [Community_Detection_1a_Louvain_Estimate.cypher](./Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher) | Community_Detection | Community Detection Louvain Estimate Memory | -| [Community_Detection_1b_Louvain_Statistics.cypher](./Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher) | Community_Detection | Community Detection Louvain Statistics | -| [Community_Detection_1c_Louvain_Mutate.cypher](./Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher) | Community_Detection | Community Detection Louvain Mutate | -| [Community_Detection_1d_Louvain_Stream.cypher](./Community_Detection/Community_Detection_1d_Louvain_Stream.cypher) | Community_Detection | Community Detection Louvain Stream | -| [Community_Detection_1d_Stream_Intermediate_Mutated.cypher](./Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher) | Community_Detection | Community Detection Stream Intermediate Mutated for hierarchical algorithmns (Louvain, Leiden) | -| [Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher](./Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher) | Community_Detection | Community Detection Louvain Write communityLouvainIntermediateIds | -| [Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher](./Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher) | Community_Detection | Community Detection Louvain write node property communityLouvainId | -| [Community_Detection_2a_Leiden_Estimate.cypher](./Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher) | Community_Detection | Community Detection Leiden Estimate Memory | -| [Community_Detection_2b_Leiden_Statistics.cypher](./Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher) | Community_Detection | Community Detection Leiden Statistics | -| [Community_Detection_2b_Leiden_Tuneable_Statistics.cypher](./Community_Detection/Community_Detection_2b_Leiden_Tuneable_Statistics.cypher) | Community_Detection | Community Detection Leiden Statistics | -| [Community_Detection_2c_Leiden_Mutate.cypher](./Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher) | Community_Detection | Community Detection Leiden Mutate | -| [Community_Detection_2d_Leiden_Stream.cypher](./Community_Detection/Community_Detection_2d_Leiden_Stream.cypher) | Community_Detection | Community Detection Leiden Stream | -| [Community_Detection_2d_Leiden_Tuneable_Write.cypher](./Community_Detection/Community_Detection_2d_Leiden_Tuneable_Write.cypher) | Community_Detection | Community Detection Leiden Write property communityLeidenId | -| [Community_Detection_2d_Leiden_Write_Node_Property.cypher](./Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher) | Community_Detection | Community Detection Leiden Write property communityLeidenId | -| [Community_Detection_3a_StronglyConnectedComponents_Estimate.cypher](./Community_Detection/Community_Detection_3a_StronglyConnectedComponents_Estimate.cypher) | Community_Detection | Community Detection Strongly Connected Components Estimate | -| [Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher](./Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher) | Community_Detection | Community Detection Weakly Connected Components | -| [Community_Detection_3b_StronglyConnectedComponents_Statistics.cypher](./Community_Detection/Community_Detection_3b_StronglyConnectedComponents_Statistics.cypher) | Community_Detection | Community Detection Strongly Connected Components Statistics | -| [Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher](./Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher) | Community_Detection | Community Detection Weakly Connected Components Statistics | -| [Community_Detection_3c_StronglyConnectedComponents_Mutate.cypher](./Community_Detection/Community_Detection_3c_StronglyConnectedComponents_Mutate.cypher) | Community_Detection | Community Detection Strongly Connected Components Mutate | -| [Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher](./Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher) | Community_Detection | Community Detection Weakly Connected Components Mutate | -| [Community_Detection_3d_StrongyConnectedComponents_Stream.cypher](./Community_Detection/Community_Detection_3d_StrongyConnectedComponents_Stream.cypher) | Community_Detection | Community Detection Strongly Connected Components Stream | -| [Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher](./Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher) | Community_Detection | Community Detection Weakly Connected Components Stream | -| [Community_Detection_3e_StronglyConnectedComponents_Write.cypher](./Community_Detection/Community_Detection_3e_StronglyConnectedComponents_Write.cypher) | Community_Detection | Community Detection Strongly Connected Components write node property communityStronglyConnectedComponentId | -| [Community_Detection_3e_WeaklyConnectedComponents_Write.cypher](./Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher) | Community_Detection | Community Detection Weakly Connected Components write node property communityWeaklyConnectedComponentId | -| [Community_Detection_4a_Label_Propagation_Estimate.cypher](./Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher) | Community_Detection | Community Detection Label Propagation Estimate | -| [Community_Detection_4b_Label_Propagation_Statistics.cypher](./Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher) | Community_Detection | Community Detection Label Propagation Statistics | -| [Community_Detection_4c_Label_Propagation_Mutate.cypher](./Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher) | Community_Detection | Community Detection Label Propagation Mutate | -| [Community_Detection_4d_Label_Propagation_Stream.cypher](./Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher) | Community_Detection | Community Detection Label Propagation Stream | -| [Community_Detection_4e_Label_Propagation_Write.cypher](./Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher) | Community_Detection | Community Detection Label Propagation write node property communityLabelPropagationId | -| [Community_Detection_5a_K_Core_Decomposition_Estimate.cypher](./Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher) | Community_Detection | Community Detection K-Core Decomposition Estimate | -| [Community_Detection_5b_K_Core_Decomposition_Statistics.cypher](./Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher) | Community_Detection | Community Detection K-Core Decomposition Statistics | -| [Community_Detection_5c_K_Core_Decomposition_Mutate.cypher](./Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher) | Community_Detection | Community Detection K-Core Decomposition Mutate | -| [Community_Detection_5d_K_Core_Decomposition_Stream.cypher](./Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher) | Community_Detection | Community Detection K-Core Decomposition Stream | -| [Community_Detection_5e_K_Core_Decomposition_Write.cypher](./Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher) | Community_Detection | Community Detection K-Core Decomposition write node property communitykCoreDecompositionValue | -| [Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher](./Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Estimate | -| [Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher](./Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Mutate | -| [Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher](./Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher) | Community_Detection | Community Detection Approximate Maximum k-cut Stream | -| [Community_Detection_7d_Modularity.cypher](./Community_Detection/Community_Detection_7d_Modularity.cypher) | Community_Detection | Community Detection Modularity | -| [Community_Detection_7d_Modularity_Members.cypher](./Community_Detection/Community_Detection_7d_Modularity_Members.cypher) | Community_Detection | Community Detection Modularity Members. Requires "Add_file_name and_extension.cypher". | -| [Community_Detection_7e_Write_Modularity.cypher](./Community_Detection/Community_Detection_7e_Write_Modularity.cypher) | Community_Detection | Community Detection Modularity Write | -| [Community_Detection_8d_Conductance.cypher](./Community_Detection/Community_Detection_8d_Conductance.cypher) | Community_Detection | Community Detection Conductance | -| [Community_Detection_8d_Conductance_Members.cypher](./Community_Detection/Community_Detection_8d_Conductance_Members.cypher) | Community_Detection | Community Detection Conductance Members. Requires "Add_file_name and_extension.cypher". | -| [Community_Detection_9_Community_Metrics.cypher](./Community_Detection/Community_Detection_9_Community_Metrics.cypher) | Community_Detection | Community Metrics. Requires "Add_file_name and_extension.cypher". | -| [Community_Detection_Summary.cypher](./Community_Detection/Community_Detection_Summary.cypher) | Community_Detection | Community Detection Summary. Variables: dependencies_projection_node ("Artifact", "Package", "Type"). Requires "Add_file_name and_extension.cypher". | -| [Compare_Louvain_vs_Leiden_Results.cypher](./Community_Detection/Compare_Louvain_vs_Leiden_Results.cypher) | Community_Detection | Compare Louvain vs. Leiden Community Detection Results. Variables: dependencies_projection_node (e.g. "Artifact", "Package", "Type"). Requires "Add_file_name and_extension.cypher". | -| [Get_all_Packages_with_a_Community_Detection_Label.cypher](./Community_Detection/Get_all_Packages_with_a_Community_Detection_Label.cypher) | Community_Detection | Get all Packages with a Community Detection Label | -| [Set_Parameters.cypher](./Community_Detection/Set_Parameters.cypher) | Community_Detection | Example on how to set the parameters for community detaction in this case for Packages and Leiden | -| [Type_communities_that_span_the_most_packages.cypher](./Community_Detection/Type_communities_that_span_the_most_packages.cypher) | Community_Detection | Communities that span the most packages. Requires "Add_file_name and_extension.cypher". | -| [Type_communities_that_span_the_most_packages_with_type_statistics.cypher](./Community_Detection/Type_communities_that_span_the_most_packages_with_type_statistics.cypher) | Community_Detection | Communities that span the most packages with type statistics | -| [Type_communities_with_few_members_in_foreign_packages.cypher](./Community_Detection/Type_communities_with_few_members_in_foreign_packages.cypher) | Community_Detection | Type communities with few members in foreign packages. Requires "Add_file_name and_extension.cypher". | -| [Which_package_community_spans_multiple_artifacts.cypher](./Community_Detection/Which_package_community_spans_multiple_artifacts.cypher) | Community_Detection | Which package community spans multiple artifacts? Requires "Add_file_name and_extension.cypher". | -| [Which_package_community_spans_several_artifacts_and_how_are_the_packages_distributed.cypher](./Community_Detection/Which_package_community_spans_several_artifacts_and_how_are_the_packages_distributed.cypher) | Community_Detection | Which package community spans several artifacts and how are the packages distributed? Requires "Add_file_name and_extension.cypher". | -| [Which_type_community_spans_several_artifacts_and_how_are_the_types_distributed.cypher](./Community_Detection/Which_type_community_spans_several_artifacts_and_how_are_the_types_distributed.cypher) | Community_Detection | Which type community spans several artifacts and how are the types distributed? Requires "Add_file_name and_extension.cypher". | -| [Count_nodes_and_relationships.cypher](./Count_nodes_and_relationships.cypher) | | Count nodes and relationships | -| [Create_Java_Type_index_for_full_qualified_name.cypher](./Create_Java_Type_index_for_full_qualified_name.cypher) | | Create index for the full qualified type name | -| [Create_Typescript_index_for_full_qualified_name.cypher](./Create_Typescript_index_for_full_qualified_name.cypher) | | Create index for the full qualified type name | -| [Create_Typescript_index_for_name.cypher](./Create_Typescript_index_for_name.cypher) | | Create index for the name for Typescript nodes | -| [Data_verification_DEPENDS_ON_relationships.cypher](./Data_verification_DEPENDS_ON_relationships.cypher) | | Data verification DEPENDS_ON relationship distinct label constellations | -| [Dependencies_0_Check_Projectable.cypher](./Dependencies_Projection/Dependencies_0_Check_Projectable.cypher) | Dependencies_Projection | Check if there is at least one projectable dependency. Variables: dependencies_projection_node, dependencies_projection_weight_property | -| [Dependencies_0_Check_Projection_Exists.cypher](./Dependencies_Projection/Dependencies_0_Check_Projection_Exists.cypher) | Dependencies_Projection | Check if the projection exists. Variables: dependencies_projection | -| [Dependencies_0_Prepare_Projection.cypher](./Dependencies_Projection/Dependencies_0_Prepare_Projection.cypher) | Dependencies_Projection | Prepare projection by e.g. filling in default values for missing properties | -| [Dependencies_0_Verify_Projectable.cypher](./Dependencies_Projection/Dependencies_0_Verify_Projectable.cypher) | Dependencies_Projection | Verify that nodes and relationships are complete and ready for projection | -| [Dependencies_10_Delete_Label.cypher](./Dependencies_Projection/Dependencies_10_Delete_Label.cypher) | Dependencies_Projection | Community Detection Label Propagation Label Delete | -| [Dependencies_11_Add_Label.cypher](./Dependencies_Projection/Dependencies_11_Add_Label.cypher) | Dependencies_Projection | Write a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | -| [Dependencies_12_Get_Projection_Statistics.cypher](./Dependencies_Projection/Dependencies_12_Get_Projection_Statistics.cypher) | Dependencies_Projection | Get dependency projection statistics | -| [Dependencies_13_Sample_Projected_Graph.cypher](./Dependencies_Projection/Dependencies_13_Sample_Projected_Graph.cypher) | Dependencies_Projection | Creates a smaller projection by sampling the original graph using "Common Neighbour Aware Random Walk" | -| [Dependencies_14_Write_Batch_Data.cypher](./Dependencies_Projection/Dependencies_14_Write_Batch_Data.cypher) | Dependencies_Projection | Writes batch data back into the database for code units when working with a dependencies projection. Variables: dependencies_projection_rows, dependencies_projection_node | -| [Dependencies_1_Delete_Projection.cypher](./Dependencies_Projection/Dependencies_1_Delete_Projection.cypher) | Dependencies_Projection | Delete projection if existing. Variables: dependencies_projection | -| [Dependencies_2_Delete_Subgraph.cypher](./Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher) | Dependencies_Projection | Delete filtered subgraph projection if exists. Variables: dependencies_projection | -| [Dependencies_3_Create_Projection.cypher](./Dependencies_Projection/Dependencies_3_Create_Projection.cypher) | Dependencies_Projection | Create directed projection. Variables: dependencies_projection, dependencies_projection_node, dependencies_projection_weight_property | -| [Dependencies_3b_Create_Multi_Relationship_Projection.cypher](./Dependencies_Projection/Dependencies_3b_Create_Multi_Relationship_Projection.cypher) | Dependencies_Projection | Create multi relationship projection. Variables: dependencies_projection, dependencies_projection_node | -| [Dependencies_3c_Create_Java_Type_Projection.cypher](./Dependencies_Projection/Dependencies_3c_Create_Java_Type_Projection.cypher) | Dependencies_Projection | Create filtered Java Type node projection without zero-degree nodes, external types, java types or duplicates. Variables: dependencies_projection. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | -| [Dependencies_3d_Create_Java_Method_Projection.cypher](./Dependencies_Projection/Dependencies_3d_Create_Java_Method_Projection.cypher) | Dependencies_Projection | Create directed projection for public Java methods filtering out constructors, getters and setters. Variables: dependencies_projection, dependencies_projection_weight_property | -| [Dependencies_4_Create_Undirected_Projection.cypher](./Dependencies_Projection/Dependencies_4_Create_Undirected_Projection.cypher) | Dependencies_Projection | Create undirected projection. Variables: dependencies_projection, dependencies_projection_node, dependencies_projection_weight_property | -| [Dependencies_4c_Create_Undirected_Java_Type_Projection.cypher](./Dependencies_Projection/Dependencies_4c_Create_Undirected_Java_Type_Projection.cypher) | Dependencies_Projection | Create filtered Java Type node projection without zero-degree nodes, external types, java types or duplicates. Variables: dependencies_projection. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | -| [Dependencies_5_Create_Subgraph.cypher](./Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher) | Dependencies_Projection | Create filtered subgraph projection without zero-degree nodes. Variables: dependencies_projection, dependencies_projection_node | -| [Dependencies_6_Check_Projection_Nodes.cypher](./Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher) | Dependencies_Projection | Check Projection Node Properties | -| [Dependencies_7_Check_Projection_Relationships.cypher](./Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher) | Dependencies_Projection | Check Projection Relationships | -| [Dependencies_8_Stream_Mutated.cypher](./Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher) | Dependencies_Projection | Read a property from projected nodes unordered. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | -| [Dependencies_8_Stream_Mutated_Extended.cypher](./Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher) | Dependencies_Projection | Read a property from projected nodes extended by some details. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | -| [Dependencies_8_Stream_Mutated_Grouped.cypher](./Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher) | Dependencies_Projection | Read a property from projected nodes. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | -| [Dependencies_8_Stream_Mutated_Value_Descending.cypher](./Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher) | Dependencies_Projection | Read a property from projected nodes ordered by their value descending. Variables: dependencies_projection, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher", "Set_localRootPath_for_modules", "Set_declaring_type_on_method_nodes". | -| [Dependencies_9_Write_Mutated.cypher](./Dependencies_Projection/Dependencies_9_Write_Mutated.cypher) | Dependencies_Projection | Write a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | -| [Set_Parameters.cypher](./Dependencies_Projection/Set_Parameters.cypher) | Dependencies_Projection | Example on how to set the parameters for the dependencies projection in this case for Packages and the useage with PageRank | -| [Add_fine_grained_weights_for_Typescript_external_module_dependencies.cypher](./DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_external_module_dependencies.cypher) | DependsOn_Relationship_Weights | Add fine grained weight properties for dependencies between Typescript modules | -| [Add_fine_grained_weights_for_Typescript_internal_module_dependencies.cypher](./DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_internal_module_dependencies.cypher) | DependsOn_Relationship_Weights | Add fine grained weight properties for dependencies between internal Typescript modules | -| [Add_weight10PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher](./DependsOn_Relationship_Weights/Add_weight10PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher) | DependsOn_Relationship_Weights | Add weight10PercentInterfaces to Package DEPENDS_ON relationships | -| [Add_weight25PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher](./DependsOn_Relationship_Weights/Add_weight25PercentInterfaces_to_Java_Package_DEPENDS_ON_relationships.cypher) | DependsOn_Relationship_Weights | Add weight25PercentInterfaces to Package DEPENDS_ON relationships | -| [Add_weight_property_for_Java_Interface_Dependencies_to_Package_DEPENDS_ON_Relationship.cypher](./DependsOn_Relationship_Weights/Add_weight_property_for_Java_Interface_Dependencies_to_Package_DEPENDS_ON_Relationship.cypher) | DependsOn_Relationship_Weights | Add weight property for Interface Dependencies to Package DEPENDS_ON Relationship | -| [Add_weight_property_to_Java_Package_DEPENDS_ON_Relationship.cypher](./DependsOn_Relationship_Weights/Add_weight_property_to_Java_Package_DEPENDS_ON_Relationship.cypher) | DependsOn_Relationship_Weights | Add weight property to Package DEPENDS_ON Relationship | -| [Explore_DEPENDS_ON_relationships.cypher](./Exploration/Explore_DEPENDS_ON_relationships.cypher) | Exploration | Explore DEPENDS_ON relationships schema | -| [Explore_ExternalDeclaration.cypher](./Exploration/Explore_ExternalDeclaration.cypher) | Exploration | External declarations split by their module and their contained symbols | -| [Explore_Module_outgoing_dependencies.cypher](./Exploration/Explore_Module_outgoing_dependencies.cypher) | Exploration | Explore outgoing dependencies of modules | -| [Explore_Typescript_elements_with_same_globalFqn.cypher](./Exploration/Explore_Typescript_elements_with_same_globalFqn.cypher) | Exploration | Explore Typescript elements with same globalFqn | -| [Explore_Typescript_modules_overview.cypher](./Exploration/Explore_Typescript_modules_overview.cypher) | Exploration | Explore nodes grouped by their module (first part of globalFqn) | -| [Explore_Typescript_modules_per_symboltype.cypher](./Exploration/Explore_Typescript_modules_per_symboltype.cypher) | Exploration | Explore nodes grouped by their module (first part of globalFqn) and their type of contained symbols | -| [Explore_Typescript_projects.cypher](./Exploration/Explore_Typescript_projects.cypher) | Exploration | Explore Typescript Projects | -| [Explore_common_globalfqn_prefix.cypher](./Exploration/Explore_common_globalfqn_prefix.cypher) | Exploration | Get common global full qualified name prefix | -| [Explore_degree_schema.cypher](./Exploration/Explore_degree_schema.cypher) | Exploration | Explore incoming/outgoing relationship (degree) schema | -| [Explore_external_Typescript_dependencies.cypher](./Exploration/Explore_external_Typescript_dependencies.cypher) | Exploration | Explore Typescript nodes with globalFqn property by their label, count and if they came from the node_modules folder | -| [Explore_node_properties.cypher](./Exploration/Explore_node_properties.cypher) | Exploration | Explore node properties, the labels of their nodes and their count | -| [Explore_node_properties_non_null.cypher](./Exploration/Explore_node_properties_non_null.cypher) | Exploration | Explore non null node property counts for the selected node label. Variables: projection_node_label | -| [Explore_node_relationships.cypher](./Exploration/Explore_node_relationships.cypher) | Exploration | Get all relationships of one specific node to explore the schema | -| [Explore_schema.cypher](./Exploration/Explore_schema.cypher) | Exploration | Explore node labels and their relationships for a schema overview | -| [Export_the_whole_database_as_CSV.cypher](./Export_the_whole_database_as_CSV.cypher) | | Export the whole database as CSV | -| [Add_file_name and_extension.cypher](./General_Enrichment/Add_file_name and_extension.cypher) | General_Enrichment | | -| [Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher](./GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher) | GitLog | Take the already existing "CHANGED_TOGETHER_WITH" relationship between git files and apply it to resolved file nodes. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | -| [Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher](./GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher) | GitLog | Connect git files that where changed together frequently with "CHANGED_TOGETHER_WITH" | -| [Add_HAS_PARENT_relationships_to_commits.cypher](./GitLog/Add_HAS_PARENT_relationships_to_commits.cypher) | GitLog | Creates a HAS_PARENT relationship between Git Commit nodes and their parent. | -| [Add_RESOLVES_TO_relationships_to_git_files_for_Java.cypher](./GitLog/Add_RESOLVES_TO_relationships_to_git_files_for_Java.cypher) | GitLog | Connect git files to Java code files with a RESOLVES_TO relationship if their names match Note: Its quite tricky to match Java class file paths from inside e.g. *.jar files to their source repository file path reliable. This could be improved by utilizing package manager data (like maven). Even that turns out to be not easy, since the folder structure can be customized. Therefore, this is only a simplified attempt and by no means complete. Note: Even if is tempting to combine this file with the Typescript variant, they are intentionally separated. The differences are subtle but need to be thought through and tested carefully. Having separate files makes it obvious that there needs to be one for every new source code language. | -| [Add_RESOLVES_TO_relationships_to_git_files_for_Typescript.cypher](./GitLog/Add_RESOLVES_TO_relationships_to_git_files_for_Typescript.cypher) | GitLog | Connect git files to Typescript files with a RESOLVES_TO relationship if their names match Note: Even if is tempting to combine this file with the Java variant, they are intentionally separated. The differences are subtle but need to be thought through and tested carefully. Having separate files makes it obvious that there needs to be one for every new source code language. | -| [Create_git_repository_node.cypher](./GitLog/Create_git_repository_node.cypher) | GitLog | Create git repository information node | -| [Delete_git_log_data.cypher](./GitLog/Delete_git_log_data.cypher) | GitLog | Delete all Git log data in the Graph | -| [Delete_plain_git_directory_file_nodes.cypher](./GitLog/Delete_plain_git_directory_file_nodes.cypher) | GitLog | Delete plain file nodes in "/.git" directory | -| [Import_aggregated_git_log_csv_data.cypher](./GitLog/Import_aggregated_git_log_csv_data.cypher) | GitLog | Import aggregated git log CSV data with the following schema: (Git:Log:Author)-[:AUTHORED]->(Git:Log:ChangeSpan)-[:CONTAINS]->(Git:Log:File) , (Git:Repository)-[:HAS_CHANGE_SPAN]->(Git:Log:ChangeSpan) , (Git:Repository)-[:HAS_AUTHER]->(Git:Log:Auther) , (Git:Repository)-[:HAS_FILE]->(Git:Log:File). Variables: git_repository_absolute_directory_name | -| [Import_git_log_csv_data.cypher](./GitLog/Import_git_log_csv_data.cypher) | GitLog | Import git log CSV data with the following schema: (Git:Log:Author)-[:AUTHORED]->(Git:Log:Commit)-[:CONTAINS]->(Git:Log:File) , (Git:Repository)-[:HAS_HAS_COMMIT]->(Git:Log:Commit) , (Git:Repository)-[:HAS_HAS_AUTHOR]->(Git:Log:Author) , (Git:Repository)-[:HAS_HAS_FILE]->(Git:Log:File). Variables: git_repository_absolute_directory_name | -| [Index_absolute_file_name.cypher](./GitLog/Index_absolute_file_name.cypher) | GitLog | Create index for the absolute file name | -| [Index_author_name.cypher](./GitLog/Index_author_name.cypher) | GitLog | Create index for author name (git data) | -| [Index_change_span_year.cypher](./GitLog/Index_change_span_year.cypher) | GitLog | Create index for change span year (aggregated git data) | -| [Index_commit_hash.cypher](./GitLog/Index_commit_hash.cypher) | GitLog | Create index for commit hash (git data) | -| [Index_commit_parent.cypher](./GitLog/Index_commit_parent.cypher) | GitLog | Create index for parent commit hash (git data) | -| [Index_commit_sha.cypher](./GitLog/Index_commit_sha.cypher) | GitLog | Create index for git commit sha | -| [Index_file_name.cypher](./GitLog/Index_file_name.cypher) | GitLog | Create index for the file name | -| [Index_file_relative_path.cypher](./GitLog/Index_file_relative_path.cypher) | GitLog | Create index for the relative file path | -| [List_ambiguous_git_files.cypher](./GitLog/List_ambiguous_git_files.cypher) | GitLog | List ambigiously resolved git files where a single git file is attached to more than one code file for troubleshooting/testing. | -| [List_git_file_directories_with_commit_statistics.cypher](./GitLog/List_git_file_directories_with_commit_statistics.cypher) | GitLog | List git file directories and their statistics | -| [List_git_files_by_resolved_label_and_extension.cypher](./GitLog/List_git_files_by_resolved_label_and_extension.cypher) | GitLog | List resolved and unresolved git files by their extension | -| [List_git_files_per_commit_distribution.cypher](./GitLog/List_git_files_per_commit_distribution.cypher) | GitLog | List how many git commits changed one file, how mandy changed two files, .... | -| [List_git_files_that_were_changed_together.cypher](./GitLog/List_git_files_that_were_changed_together.cypher) | GitLog | List git files that where changed together frequently. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | -| [List_git_files_that_were_changed_together_all_in_one.cypher](./GitLog/List_git_files_that_were_changed_together_all_in_one.cypher) | GitLog | List git files that where changed together frequently | -| [List_git_files_that_were_changed_together_with_another_file.cypher](./GitLog/List_git_files_that_were_changed_together_with_another_file.cypher) | GitLog | List git files that where frequently changed with another file. Requires "Add_CHANGED_TOGETHER_WITH_relationships_to_git_files". | -| [List_git_files_that_were_changed_together_with_another_file_all_in_one.cypher](./GitLog/List_git_files_that_were_changed_together_with_another_file_all_in_one.cypher) | GitLog | List git files that where changed together frequently | -| [List_git_files_with_commit_statistics_by_author.cypher](./GitLog/List_git_files_with_commit_statistics_by_author.cypher) | GitLog | List git files with commit statistics | -| [List_pairwise_changed_files.cypher](./GitLog/List_pairwise_changed_files.cypher) | GitLog | List pairs of files that were changed together. Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first. | -| [List_pairwise_changed_files_top_selected_metric.cypher](./GitLog/List_pairwise_changed_files_top_selected_metric.cypher) | GitLog | Get the top 4 file extensions that where changed together most often and list top 20 pair that were changed together for each of the top file extension pair by their highest commit lift (>1: changes more often than by random chance). Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first. | -| [List_pairwise_changed_files_with_dependencies.cypher](./GitLog/List_pairwise_changed_files_with_dependencies.cypher) | GitLog | List pair of files that were changed together and that have a declared dependency between each other. Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher and Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher to run first. | -| [List_unresolved_git_files.cypher](./GitLog/List_unresolved_git_files.cypher) | GitLog | List code files not covered by imported git data for troubleshooting/testing. | -| [Set_commit_classification_properties.cypher](./GitLog/Set_commit_classification_properties.cypher) | GitLog | Classify git commits and set properties like isMergeCommit, isAutomationCommit (=isBotCommit or isMavenCommit). | -| [Set_number_of_aggregated_git_commits.cypher](./GitLog/Set_number_of_aggregated_git_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when aggregated change spans with grouped commits are present. | -| [Set_number_of_git_log_commits.cypher](./GitLog/Set_number_of_git_log_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when git commits are present | -| [Set_number_of_git_plugin_commits.cypher](./GitLog/Set_number_of_git_plugin_commits.cypher) | GitLog | Set numberOfGitCommits property on code File nodes when git commits (detected by the plugin) are present | -| [Set_number_of_git_plugin_update_commits.cypher](./GitLog/Set_number_of_git_plugin_update_commits.cypher) | GitLog | Set updateCommitCount property on Git File nodes when git commits with Update modifier (detected by the plugin) are present | -| [Verify_code_to_git_file_unambiguous.cypher](./GitLog/Verify_code_to_git_file_unambiguous.cypher) | GitLog | Verify that code to git file relationships aren't ambiguous | -| [Verify_git_missing_CHANGED_TOGETHER_WITH_properties.cypher](./GitLog/Verify_git_missing_CHANGED_TOGETHER_WITH_properties.cypher) | GitLog | Verify if CHANGED_TOGETHER_WITH properties from git are missing | -| [Verify_git_missing_create_date.cypher](./GitLog/Verify_git_missing_create_date.cypher) | GitLog | Verify that git to code file relationships aren't ambiguous | -| [Verify_git_to_code_file_unambiguous.cypher](./GitLog/Verify_git_to_code_file_unambiguous.cypher) | GitLog | Verify that git to code file relationships aren't ambiguous | -| [Annotated_code_elements.cypher](./Java/Annotated_code_elements.cypher) | Java | Annotated code elements overall by element type with some examples | -| [Annotated_code_elements_per_artifact.cypher](./Java/Annotated_code_elements_per_artifact.cypher) | Java | Annotated code elements per artifact and element type with some examples. Requires "Add_file_name and_extension.cypher". | -| [Get_all_declared_and_inherited_methods_of_a_type.cypher](./Java/Get_all_declared_and_inherited_methods_of_a_type.cypher) | Java | Get all declared and inherited methods of a type | -| [JakartaEE_REST_Annotations.cypher](./Java/JakartaEE_REST_Annotations.cypher) | Java | Jakarta Enterprise Edition JAX-RS REST Annotations. Requires "Add_file_name and_extension.cypher". --- Method Http Annotation --- | -| [JakartaEE_REST_Annotations_Nodes.cypher](./Java/JakartaEE_REST_Annotations_Nodes.cypher) | Java | Jakarta Enterprise Edition JAX-RS REST Annotations Nodes --- Method Http Annotation --- | -| [Java_Reflection_usage.cypher](./Java/Java_Reflection_usage.cypher) | Java | Query Java Reflection usage combined with invocations of "Class.forName". Requires "Add_file_name and_extension.cypher". | -| [Java_Reflection_usage_detailed.cypher](./Java/Java_Reflection_usage_detailed.cypher) | Java | Query all types that use Java Reflection or "Class.forName". Requires "Add_file_name and_extension.cypher". | -| [Java_deprecated_element_usage.cypher](./Java/Java_deprecated_element_usage.cypher) | Java | Query deprecated type and member usage by non deprecated elements. Requires "Add_file_name and_extension.cypher". | -| [Java_deprecated_element_usage_detailed.cypher](./Java/Java_deprecated_element_usage_detailed.cypher) | Java | List all non deprecated elements (types, members) that call deprecated elements. Requires "Add_file_name and_extension.cypher". | -| [Label_external_types_and_annotations.cypher](./Java/Label_external_types_and_annotations.cypher) | Java | Label external types and external annotations. Requires 'Label_base_java_types', 'Label_buildin_java_types' and 'Label_resolved_duplicate_types' of 'Types' directory. | -| [Remove_external_type_and_annotation_labels.cypher](./Java/Remove_external_type_and_annotation_labels.cypher) | Java | Remove external type and annotation labels | -| [Spring_Web_Request_Annotations.cypher](./Java/Spring_Web_Request_Annotations.cypher) | Java | Spring Web Request Annotations. Requires "Add_file_name and_extension.cypher". --- Method HTTP Annotation --- | -| [Calculate_and_set_Abstractness_for_Java.cypher](./Metrics/Calculate_and_set_Abstractness_for_Java.cypher) | Metrics | Calculate and set Abstractness for Java Packages including Counts. Requires "Add_file_name and_extension.cypher". | -| [Calculate_and_set_Abstractness_for_Java_including_Subpackages.cypher](./Metrics/Calculate_and_set_Abstractness_for_Java_including_Subpackages.cypher) | Metrics | Calculate and set Abstractness for Java Packages including sub-packages. Requires "Add_file_name and_extension.cypher". | -| [Calculate_and_set_Abstractness_for_Typescript.cypher](./Metrics/Calculate_and_set_Abstractness_for_Typescript.cypher) | Metrics | Calculate and set Abstractness for Typescript Modules | -| [Calculate_and_set_Instability_for_Java.cypher](./Metrics/Calculate_and_set_Instability_for_Java.cypher) | Metrics | Calculate and set Instability for Java. Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | -| [Calculate_and_set_Instability_for_Java_Including_Subpackages.cypher](./Metrics/Calculate_and_set_Instability_for_Java_Including_Subpackages.cypher) | Metrics | Calculate and set Instability = outgoing / (outgoing + incoming) Dependencies. Requires "Add_file_name and_extension.cypher". | -| [Calculate_and_set_Instability_for_Typescript.cypher](./Metrics/Calculate_and_set_Instability_for_Typescript.cypher) | Metrics | Calculate and set Instability = outgoing / (outgoing + incoming) Dependencies | -| [Calculate_distance_between_abstractness_and_instability_for_Java.cypher](./Metrics/Calculate_distance_between_abstractness_and_instability_for_Java.cypher) | Metrics | Calculate distance between abstractness and instability. Requires "Add_file_name and_extension.cypher". | -| [Calculate_distance_between_abstractness_and_instability_for_Java_including_subpackages.cypher](./Metrics/Calculate_distance_between_abstractness_and_instability_for_Java_including_subpackages.cypher) | Metrics | Calculate distance between abstractness and instability including subpackages. Requires "Add_file_name and_extension.cypher". | -| [Calculate_distance_between_abstractness_and_instability_for_Typescript.cypher](./Metrics/Calculate_distance_between_abstractness_and_instability_for_Typescript.cypher) | Metrics | Calculate distance between abstractness and instability for Typescript | -| [Clear_all_metrics.cypher](./Metrics/Clear_all_metrics.cypher) | Metrics | Clear all object oriented design metrics | -| [Count_and_set_abstract_types.cypher](./Metrics/Count_and_set_abstract_types.cypher) | Metrics | Count and set abstract types | -| [Get_Abstractness_for_Java.cypher](./Metrics/Get_Abstractness_for_Java.cypher) | Metrics | Get Java Packages with the lowest abstractness first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Abstractness_for_Java_including_Subpackages.cypher](./Metrics/Get_Abstractness_for_Java_including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the lowest abstractness first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Abstractness_for_Typescript.cypher](./Metrics/Get_Abstractness_for_Typescript.cypher) | Metrics | Get Typscript Modules with the lowest abstractness first (if set before) | -| [Get_Incoming_Java_Package_Dependencies.cypher](./Metrics/Get_Incoming_Java_Package_Dependencies.cypher) | Metrics | Get Java Packages with the most incoming dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Get_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub-packages with the most incoming dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Incoming_Typescript_Module_Dependencies.cypher](./Metrics/Get_Incoming_Typescript_Module_Dependencies.cypher) | Metrics | Get Typscript Modules with the most incoming dependencies first (if set before) | -| [Get_Instability_for_Java.cypher](./Metrics/Get_Instability_for_Java.cypher) | Metrics | Get Java Packages with the lowest Instability (outgoing / all dependencies) first (if set before). Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | -| [Get_Instability_for_Java_Including_Subpackages.cypher](./Metrics/Get_Instability_for_Java_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the lowest Instability. Requires "Add_file_name and_extension.cypher". Instability = outgoing / (outgoing + incoming) Dependencies | -| [Get_Instability_for_Typescript.cypher](./Metrics/Get_Instability_for_Typescript.cypher) | Metrics | Get Typscript Modules with the lowest Instability (outgoing / all dependencies) first (if set before) | -| [Get_Outgoing_Java_Package_Dependencies.cypher](./Metrics/Get_Outgoing_Java_Package_Dependencies.cypher) | Metrics | Get Java Packages with the most outgoing dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Get_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Get Java Packages including their sub packages with the most outgoing dependencies first (if set before). Requires "Add_file_name and_extension.cypher". | -| [Get_Outgoing_Typescript_Module_Dependencies.cypher](./Metrics/Get_Outgoing_Typescript_Module_Dependencies.cypher) | Metrics | Get Typscript Modules with the most outgoing dependencies first (if set before) | -| [Incoming_Class_Dependencies.cypher](./Metrics/Incoming_Class_Dependencies.cypher) | Metrics | Incoming Class Dependencies | -| [Incoming_Class_Method_Call_Dependencies.cypher](./Metrics/Incoming_Class_Method_Call_Dependencies.cypher) | Metrics | Incoming Class Method Call Dependencies | -| [Incoming_Package_Dependencies.cypher](./Metrics/Incoming_Package_Dependencies.cypher) | Metrics | Incoming Package Dependencies. Requires "Add_file_name and_extension.cypher". | -| [Incoming_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Incoming_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Incoming Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | -| [Incoming_Package_Method_Call_Dependencies.cypher](./Metrics/Incoming_Package_Method_Call_Dependencies.cypher) | Metrics | Incoming Package Method Call Dependencies | -| [Outgoing_Class_Dependencies.cypher](./Metrics/Outgoing_Class_Dependencies.cypher) | Metrics | Outgoing Class Dependencies | -| [Outgoing_Class_Method_Call_Dependencies.cypher](./Metrics/Outgoing_Class_Method_Call_Dependencies.cypher) | Metrics | Outgoing Class Method Call Dependencies | -| [Outgoing_Package_Dependencies.cypher](./Metrics/Outgoing_Package_Dependencies.cypher) | Metrics | Outgoing Package Dependencies. Requires "Add_file_name and_extension.cypher". | -| [Outgoing_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Outgoing_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Outgoing Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | -| [Outgoing_Package_Method_Call_Dependencies.cypher](./Metrics/Outgoing_Package_Method_Call_Dependencies.cypher) | Metrics | Outgoing Package Method Call Dependencies | -| [Set_Dependency_Degree.cypher](./Metrics/Set_Dependency_Degree.cypher) | Metrics | Set "dependencyDegree" and "dependencyDegreeWeighted" on all nodes containing a property for incoming or outgoing dependencies. Requires all "Set_Incoming*.cypher" and "Set_Outgoing*.cypher". | -| [Set_Dependency_Degree_Rank.cypher](./Metrics/Set_Dependency_Degree_Rank.cypher) | Metrics | Set "dependencyDegreeRank" on all nodes containing a "dependencyDegree" property. Requires "Set_Degree.cypher". | -| [Set_Incoming_Java_Package_Dependencies.cypher](./Metrics/Set_Incoming_Java_Package_Dependencies.cypher) | Metrics | Set Incoming Package Dependencies. Requires "Add_file_name and_extension.cypher". | -| [Set_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Set_Incoming_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Set Incoming Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | -| [Set_Incoming_Java_Package_Method_Call_Dependencies.cypher](./Metrics/Set_Incoming_Java_Package_Method_Call_Dependencies.cypher) | Metrics | Set Incoming Package Method Call Dependencies | -| [Set_Incoming_Java_Type_Dependencies.cypher](./Metrics/Set_Incoming_Java_Type_Dependencies.cypher) | Metrics | Set Incoming Type Dependencies | -| [Set_Incoming_Typescript_Module_Dependencies.cypher](./Metrics/Set_Incoming_Typescript_Module_Dependencies.cypher) | Metrics | Set incoming Typscript Module dependencies | -| [Set_Outgoing_Java_Package_Dependencies.cypher](./Metrics/Set_Outgoing_Java_Package_Dependencies.cypher) | Metrics | Set Outgoing Package Dependencies. Requires "Add_file_name and_extension.cypher". | -| [Set_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher](./Metrics/Set_Outgoing_Java_Package_Dependencies_Including_Subpackages.cypher) | Metrics | Set Outgoing Package Dependencies including sub-packages. Requires "Add_file_name and_extension.cypher". | -| [Set_Outgoing_Java_Package_Method_Call_Dependencies.cypher](./Metrics/Set_Outgoing_Java_Package_Method_Call_Dependencies.cypher) | Metrics | Set Outgoing Package Method Call Dependencies | -| [Set_Outgoing_Java_Type_Dependencies.cypher](./Metrics/Set_Outgoing_Java_Type_Dependencies.cypher) | Metrics | Set Outgoing Type Dependencies | -| [Set_Outgoing_Typescript_Module_Dependencies.cypher](./Metrics/Set_Outgoing_Typescript_Module_Dependencies.cypher) | Metrics | Set outgoing Typscript Module dependencies | -| [Adding_the_artifact_name_temporarily_to_a_new_virtual_node_using_APOC.cypher](./Miscellaneous/Adding_the_artifact_name_temporarily_to_a_new_virtual_node_using_APOC.cypher) | Miscellaneous | Adding the artifact name temporarily to a new virtual node using APOC. Doesn't take all relationships into account and therefore doesn't work yet. | -| [Adding_the_artifact_name_temporarily_to_the_Package_node_using_map_projection.cypher](./Miscellaneous/Adding_the_artifact_name_temporarily_to_the_Package_node_using_map_projection.cypher) | Miscellaneous | Adding the artifact name temporarily to the Package node using map projection | -| [Extract_Custom_Manifest_Entries.cypher](./Miscellaneous/Extract_Custom_Manifest_Entries.cypher) | Miscellaneous | Extract Custom Manifest Entries | -| [Get_Awesome_Procedures_On_Cypher_APOC_Version.cypher](./Miscellaneous/Get_Awesome_Procedures_On_Cypher_APOC_Version.cypher) | Miscellaneous | Get Awesome Procedures On Cypher APOC Version | -| [Get_Graph_Data_Science_Library_Version.cypher](./Miscellaneous/Get_Graph_Data_Science_Library_Version.cypher) | Miscellaneous | Get Graph Data Science Library Version | -| [Get_Graph_Data_Science_System_Information.cypher](./Miscellaneous/Get_Graph_Data_Science_System_Information.cypher) | Miscellaneous | Get Graph Data Science System Information | -| [Set_artifactName_property_on_every_Package_node.cypher](./Miscellaneous/Set_artifactName_property_on_every_Package_node.cypher) | Miscellaneous | Set artifactName property on every Package node. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_0a_Query_Calculated.cypher](./Node_Embeddings/Node_Embeddings_0a_Query_Calculated.cypher) | Node_Embeddings | Query already calculated and written node embeddings on nodes with label in parameter $dependencies_projection_node including a communityId and centrality. Variables: dependencies_projection_node, dependencies_projection_write_property. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_0b_Prepare_Degree.cypher](./Node_Embeddings/Node_Embeddings_0b_Prepare_Degree.cypher) | Node_Embeddings | Node Embeddings 0b: Prepare: Calculate Degree Property. | -| [Node_Embeddings_0c_Drop_Model.cypher](./Node_Embeddings/Node_Embeddings_0c_Drop_Model.cypher) | Node_Embeddings | Node Embeddings 0b: Prepare: Calculate Degree Property. | -| [Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher](./Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher) | Node_Embeddings | Node Embeddings 1a using Fast Random Projection: Estimate | -| [Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher](./Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher) | Node_Embeddings | Node Embeddings 1b using Fast Random Projection: Statistics | -| [Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher](./Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher) | Node_Embeddings | Node Embeddings 1c using Fast Random Projection: Mutate | -| [Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher](./Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Stream. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_1d_Fast_Random_Projection_Tuneable_Stream.cypher](./Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Stream for Hyper-Parameter tuning. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_1e_Fast_Random_Projection_Tuneable_Write.cypher](./Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Tuneable_Write.cypher) | Node_Embeddings | Node Embeddings 1e using Fast Random Projection: Write for tuned hyper-parameters. | -| [Node_Embeddings_1e_Fast_Random_Projection_Write.cypher](./Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher) | Node_Embeddings | Node Embeddings 1d using Fast Random Projection: Write | -| [Node_Embeddings_2a_Hash_GNN_Estimate.cypher](./Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher) | Node_Embeddings | Node Embeddings 2a using Hash GNN (Graph Neural Networks): Estimate | -| [Node_Embeddings_2c_Hash_GNN_Mutate.cypher](./Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher) | Node_Embeddings | Node Embeddings 2b using Hash GNN (Graph Neural Networks): Mutate | -| [Node_Embeddings_2d_Hash_GNN_Stream.cypher](./Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher) | Node_Embeddings | Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_2d_Hash_GNN_Tuneable_Stream.cypher](./Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_3a_Node2Vec_Estimate.cypher](./Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher) | Node_Embeddings | Node Embeddings 3a using Node2Vec: Estimate | -| [Node_Embeddings_3c_Node2Vec_Mutate.cypher](./Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Mutate | -| [Node_Embeddings_3d_Node2Vec_Stream.cypher](./Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Stream. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_3d_Node2Vec_Tuneable_Stream.cypher](./Node_Embeddings/Node_Embeddings_3d_Node2Vec_Tuneable_Stream.cypher) | Node_Embeddings | Node Embeddings 3c using Node2Vec: Stream. Requires "Add_file_name and_extension.cypher". | -| [Node_Embeddings_3e_Node2Vec_Write.cypher](./Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher) | Node_Embeddings | Node Embeddings 3d using Node2Vec: Write | -| [Node_Embeddings_4b_GraphSAGE_Train.cypher](./Node_Embeddings/Node_Embeddings_4b_GraphSAGE_Train.cypher) | Node_Embeddings | Node Embeddings 4c using GraphSAGE (Graph Neural Networks): Train. Requires: "Node_Embeddings_0b_Prepare_Degree.cypher". | -| [Node_Embeddings_4d_GraphSAGE_Stream.cypher](./Node_Embeddings/Node_Embeddings_4d_GraphSAGE_Stream.cypher) | Node_Embeddings | Node Embeddings 4d using GraphSAGE: Stream. Requires "Add_file_name and_extension.cypher". | -| [Set_Parameters.cypher](./Node_Embeddings/Set_Parameters.cypher) | Node_Embeddings | Example on how to set the parameters for node embeddings in this case for Packages and Node2Vec | -| [Cyclomatic_Method_Complexity_Distribution.cypher](./Overview/Cyclomatic_Method_Complexity_Distribution.cypher) | Overview | Cyclomatic Complexity Method Complexity Distribution | -| [Dependency_node_labels.cypher](./Overview/Dependency_node_labels.cypher) | Overview | Explore DEPENDS_ON relationship node labels | -| [Effective_Method_Line_Count_Distribution.cypher](./Overview/Effective_Method_Line_Count_Distribution.cypher) | Overview | Effective Method Line Count Distribution | -| [Effective_lines_of_method_code_per_package.cypher](./Overview/Effective_lines_of_method_code_per_package.cypher) | Overview | Effective lines of method code per package. Requires "Add_file_name and_extension.cypher". | -| [Effective_lines_of_method_code_per_type.cypher](./Overview/Effective_lines_of_method_code_per_type.cypher) | Overview | Effective lines of method code per type. Requires "Add_file_name and_extension.cypher". | -| [Node_label_combination_count.cypher](./Overview/Node_label_combination_count.cypher) | Overview | Node count for each label combination. Sums up to the total number of nodes. | -| [Node_label_count.cypher](./Overview/Node_label_count.cypher) | Overview | Node count for each label separate. Doesn_t sum up to the number of total labels since one node can have multiple labels. | -| [Node_labels_and_their_relationships.cypher](./Overview/Node_labels_and_their_relationships.cypher) | Overview | List node labels and their relationship types, their count and their density. | -| [Number_of_elements_per_module_for_Typescript.cypher](./Overview/Number_of_elements_per_module_for_Typescript.cypher) | Overview | Number of elements per module for Typescript | -| [Number_of_packages_per_artifact.cypher](./Overview/Number_of_packages_per_artifact.cypher) | Overview | Number of packages per artifact. Requires "Add_file_name and_extension.cypher". | -| [Number_of_types_per_artifact.cypher](./Overview/Number_of_types_per_artifact.cypher) | Overview | Number of types per artifact. Requires "Add_file_name and_extension.cypher". | -| [Overview_size.cypher](./Overview/Overview_size.cypher) | Overview | Overview size | -| [Overview_size_for_Typescript.cypher](./Overview/Overview_size_for_Typescript.cypher) | Overview | Overview size for Typescript | -| [Relationship_type_count.cypher](./Overview/Relationship_type_count.cypher) | Overview | Relationship count for each type separate. Sums up to the total number of relationships (100%). | -| [Words_for_Wordcloud.cypher](./Overview/Words_for_Wordcloud.cypher) | Overview | Words for Wordcloud | -| [Words_for_git_author_Wordcloud_with_frequency.cypher](./Overview/Words_for_git_author_Wordcloud_with_frequency.cypher) | Overview | Wordcloud of git authors and their commit count | -| [Words_for_universal_Wordcloud.cypher](./Overview/Words_for_universal_Wordcloud.cypher) | Overview | Words for universal Wordcloud | -| [Set_Parameters.cypher](./Similarity/Set_Parameters.cypher) | Similarity | Example on how to set the parameters for similarity in this case for Packages and Node Similarity | -| [Similarity_1a_Estimate.cypher](./Similarity/Similarity_1a_Estimate.cypher) | Similarity | Similarity Estimate Memory | -| [Similarity_1b_Statistics.cypher](./Similarity/Similarity_1b_Statistics.cypher) | Similarity | Similarity Statistics | -| [Similarity_1c_Mutate.cypher](./Similarity/Similarity_1c_Mutate.cypher) | Similarity | Similarity Mutate | -| [Similarity_1d_Stream_Mutated.cypher](./Similarity/Similarity_1d_Stream_Mutated.cypher) | Similarity | Read the similarity relationship from the projection. Variables: dependencies_projection. Requires "Add_file_name and_extension.cypher". | -| [Similarity_1e_Stream.cypher](./Similarity/Similarity_1e_Stream.cypher) | Similarity | Similarity Stream. Requires "Add_file_name and_extension.cypher". | -| [Similarity_1f_Delete_Relationships.cypher](./Similarity/Similarity_1f_Delete_Relationships.cypher) | Similarity | Delete Relationship "SIMILAR" | -| [Similarity_1g_Write_Mutated.cypher](./Similarity/Similarity_1g_Write_Mutated.cypher) | Similarity | Write the Similarity relationship from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property | -| [Similarity_1h_Write.cypher](./Similarity/Similarity_1h_Write.cypher) | Similarity | Similarity Write | -| [Similarity_1i_Write_Node_Properties.cypher](./Similarity/Similarity_1i_Write_Node_Properties.cypher) | Similarity | Write similar node names and their score per node | -| [Label_base_java_types.cypher](./Types/Label_base_java_types.cypher) | Types | Label primitive Java types and void | -| [Label_buildin_java_types.cypher](./Types/Label_buildin_java_types.cypher) | Types | Label build-in Java types | -| [Label_resolved_duplicate_types.cypher](./Types/Label_resolved_duplicate_types.cypher) | Types | Label resolved duplicate types. | -| [Remove_extended_type_labels.cypher](./Types/Remove_extended_type_labels.cypher) | Types | Remove external type and annotation labels | -| [Set_declaring_type_on_method_nodes.cypher](./Types/Set_declaring_type_on_method_nodes.cypher) | Types | Set property "declaringType" on Method nodes. | -| [Add_DEPENDS_ON_relationship_to_resolved_modules.cypher](./Typescript_Enrichment/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher) | Typescript_Enrichment | Propagates "DEPENDS_ON" relations between modules to their resolved modules with a property "resolved:true" or "updated:true". Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5 | -| [Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher](./Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher) | Typescript_Enrichment | Link matching external to internal Typescript declarations with an IS_IMPLEMENTED_IN relationship | -| [Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher](./Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher) | Typescript_Enrichment | Adds a relation "IS_IMPLEMENTED_IN" from an external module to a module if their global fully qualified names match. Depends on "Add_module_properties.cypher" to be run first Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5 Related to https://github.com/jqassistant-plugin/jqassistant-typescript-plugin/issues/35 | -| [Add_module_properties.cypher](./Typescript_Enrichment/Add_module_properties.cypher) | Typescript_Enrichment | Add extended properties to Typescript nodes with a globalFqn like "namespace", "module", "name" and "extension" as well as markers like "isNodeModule", "isUnresolvedImport" and "isExternalImport" | -| [Add_name_to_property_on_projects.cypher](./Typescript_Enrichment/Add_name_to_property_on_projects.cypher) | Typescript_Enrichment | Set name property on Typescript project nodes | -| [Add_name_to_property_on_scan_nodes.cypher](./Typescript_Enrichment/Add_name_to_property_on_scan_nodes.cypher) | Typescript_Enrichment | Set name property on Typescript scan nodes | -| [Add_namespace_property_on_nodes_from_linked_npm_packages.cypher](./Typescript_Enrichment/Add_namespace_property_on_nodes_from_linked_npm_packages.cypher) | Typescript_Enrichment | Add namespace property to Typescript nodes if a npm a package is linked. Requires Link_projects_to_npm_packages. | -| [Count_internal_modules_resolving_external_ones.cypher](./Typescript_Enrichment/Count_internal_modules_resolving_external_ones.cypher) | Typescript_Enrichment | How many internal modules resolve/represent external ones (for manual exploration)? | -| [Enrich_npm_packages_with_dependency_counts.cypher](./Typescript_Enrichment/Enrich_npm_packages_with_dependency_counts.cypher) | Typescript_Enrichment | Enrich NPM:Package nodes with incoming and outgoing dependency counts Requires Link_npm_packages_with_depends_on_relationships.cypher | -| [Index_module_name.cypher](./Typescript_Enrichment/Index_module_name.cypher) | Typescript_Enrichment | Create index for module name | -| [Label_npm_packages_by_dep_type.cypher](./Typescript_Enrichment/Label_npm_packages_by_dep_type.cypher) | Typescript_Enrichment | Label NPM packages as NpmDevPackage or NpmNonDevPackage based on incoming DEPENDS_ON. Requires Link_npm_packages_with_depends_on_relationships.cypher For each package node, calculate the maximum `weightByDependencyType` across incoming `DEPENDS_ON` relationships. If the max is 1 -> label `NpmDevPackage`; if > 1 -> label `NpmNonDevPackage`. If the property is missing or < 1 then no label is added. weightByDependencyType= 1 is a dev dependency, 2 is a regular dependency, and 3 is a peer dependency. | -| [Link_external_modules_to_corresponding_npm_dependency.cypher](./Typescript_Enrichment/Link_external_modules_to_corresponding_npm_dependency.cypher) | Typescript_Enrichment | Link ExternalModule nodes to their corresponding NPM Dependency if available | -| [Link_npm_dependencies_to_npm_packages.cypher](./Typescript_Enrichment/Link_npm_dependencies_to_npm_packages.cypher) | Typescript_Enrichment | Link npm dependencies to the npm package that describes them, if it exists | -| [Link_npm_packages_with_depends_on_relationships.cypher](./Typescript_Enrichment/Link_npm_packages_with_depends_on_relationships.cypher) | Typescript_Enrichment | Link npm packages with DEPENDS_ON relationships. Requires Link_npm_dependencies_to_npm_packages. This creates direct package-to-package dependencies by following the chain: (source:NPM:Package)-[dependency_relationship]->(NPM:Dependency)-[:IS_DESCRIBED_IN_NPM_PACKAGE]->(target:NPM:Package) | -| [Link_projects_to_npm_packages.cypher](./Typescript_Enrichment/Link_projects_to_npm_packages.cypher) | Typescript_Enrichment | Link Typescript projects to npm packages | -| [Mark_test_modules.cypher](./Typescript_Enrichment/Mark_test_modules.cypher) | Typescript_Enrichment | Add "Test" label for modules that contain tests and test-related implementations | -| [Remove_duplicate_CONTAINS_relations_between_files.cypher](./Typescript_Enrichment/Remove_duplicate_CONTAINS_relations_between_files.cypher) | Typescript_Enrichment | Remove duplicate CONTAINS relationships with the same properties between files | -| [Remove_npm_dependency_type_labels.cypher](./Typescript_Enrichment/Remove_npm_dependency_type_labels.cypher) | Typescript_Enrichment | Remove NPM package type labels (idempotent). | -| [Set_localRootPath_for_modules.cypher](./Typescript_Enrichment/Set_localRootPath_for_modules.cypher) | Typescript_Enrichment | Set "rootProjectName" and some local path properties for Typescript modules | -| [Verify_module_dependencies.cypher](./Typescript_Enrichment/Verify_module_dependencies.cypher) | Typescript_Enrichment | Verify that there are either no Typescript modules at all or that there is at least one module dependency. | -| [Verify_projects_linked_to_npm_packages.cypher](./Typescript_Enrichment/Verify_projects_linked_to_npm_packages.cypher) | Typescript_Enrichment | Verify that all Typescript projects are linked to npm packages | -| [ValidateAlwaysFalse.cypher](./Validation/ValidateAlwaysFalse.cypher) | Validation | Will never return any results so that the validation will always fail. This is helpful for Jupyter Notebooks that should not be executed automatically. | -| [ValidateGitHistory.cypher](./Validation/ValidateGitHistory.cypher) | Validation | Check if there is at least one Git:Commit pointing to a Git:Change containing a Git:File from a Git:Repository | -| [ValidateJavaArtifactDependencies.cypher](./Validation/ValidateJavaArtifactDependencies.cypher) | Validation | Check if there is at least one Java Artifact dependency. | -| [ValidateJavaExternalDependencies.cypher](./Validation/ValidateJavaExternalDependencies.cypher) | Validation | Check if there is at least one external Java Type dependency. | -| [ValidateJavaInternalDependencies.cypher](./Validation/ValidateJavaInternalDependencies.cypher) | Validation | Check if there is at least one Java Artifact containing a Java Package with at least one Java Type. | -| [ValidateJavaMethods.cypher](./Validation/ValidateJavaMethods.cypher) | Validation | Check if there is at least one Java Method, its Type and an Artifact it belongs to. | -| [ValidateJavaPackageDependencies.cypher](./Validation/ValidateJavaPackageDependencies.cypher) | Validation | Check if there is at least one Java Packagte dependency. | -| [ValidateJavaTypes.cypher](./Validation/ValidateJavaTypes.cypher) | Validation | Check if there is at least one Java Method, its Type and an Artifact it belongs to. | -| [ValidateTypescriptModuleDependencies.cypher](./Validation/ValidateTypescriptModuleDependencies.cypher) | Validation | Check if there is at least one Typescript Module dependency. | -| [Global_relative_visibility_statistics_for_elements_for_Typescript.cypher](./Visibility/Global_relative_visibility_statistics_for_elements_for_Typescript.cypher) | Visibility | Global relative visibility statistics for elements for Typescript | -| [Global_relative_visibility_statistics_for_types.cypher](./Visibility/Global_relative_visibility_statistics_for_types.cypher) | Visibility | Global relative visibility statistics for types. Requires "Add_file_name and_extension.cypher". | -| [Relative_visibility_exported_elements_to_all_elements_per_module_for_Typescript.cypher](./Visibility/Relative_visibility_exported_elements_to_all_elements_per_module_for_Typescript.cypher) | Visibility | Relative visibility: exported elements to all elements per module | -| [Relative_visibility_public_types_to_all_types_per_package.cypher](./Visibility/Relative_visibility_public_types_to_all_types_per_package.cypher) | Visibility | Relative visibility: public types to all types per package. Requires "Add_file_name and_extension.cypher". | diff --git a/scripts/ENVIRONMENT_VARIABLES.md b/scripts/ENVIRONMENT_VARIABLES.md deleted file mode 100644 index 02a6da476..000000000 --- a/scripts/ENVIRONMENT_VARIABLES.md +++ /dev/null @@ -1,57 +0,0 @@ -# Environment Variables Reference - -This document serves as a reference for all environment variables that are supported by the script files. -It provides a table listing each environment variable, its default value and its corresponding description provided as a inline comment. -This file was generated with the script [appendEnvironmentVariables.sh](./appendEnvironmentVariables.sh) and [generateEnvironmentVariableReference.sh](./generateEnvironmentVariableReference.sh). - -| Environment Variable Name | Default | Description | -| ----------------------------------- | ----------------------------------- | ------------------------------------------------------ | -PREPARE_CONDA_ENVIRONMENT | true | Wether to prepare a Python environment with Conda if needed (default, "true") or use an already prepared Conda environment ("false") | -JUPYTER_NOTEBOOK_DIRECTORY | ${SCRIPTS_DIR}/../jupyter | Repository directory containing the Jupyter Notebooks | -CONDA_ENVIRONMENT_FILE | ${JUPYTER_NOTEBOOK_DIRECTORY}/../conda-environment.yml | Conda (package manager for Python) environment file path | -CODEGRAPH_CONDA_ENVIRONMENT | codegraph | Name of the conda environment to use for code graph analysis | -USE_VIRTUAL_PYTHON_ENVIRONMENT_VENV | false | Use "venv" for virtual Python environments ("true") or use an already prepared (e.g. conda) environment (default, "false"). | -PYTHON_ENVIRONMENT_FILE | ${ROOT_DIRECTORY}/requirements.txt | Pip (package manager for Python) environment file path | -REPORTS_SCRIPTS_DIRECTORY | reports | Working directory containing the generated reports | -REPORT_COMPILATIONS_SCRIPTS_DIRECTORY | compilations | Repository directory that contains scripts that execute selected report generation scripts | -SETTINGS_PROFILE_SCRIPTS_DIRECTORY | profiles | Repository directory that contains scripts containing settings | -ARTIFACTS_DIRECTORY | artifacts | Working directory containing the artifacts to be analyzed | -SOURCE_DIRECTORY | source | | -LOG_GROUP_START | ::group:: | Prefix to start a log group. Defaults to GitHub Actions log group start command. | -LOG_GROUP_END | ::endgroup:: | Prefix to end a log group. Defaults to GitHub Actions log group end command. | -DOMAINS_DIRECTORY | ${SCRIPTS_DIR}/../domains | | -NEO4J_EDITION | community | Choose "community" or "enterprise" | -NEO4J_VERSION | 2026.01.4 | | -DATA_DIRECTORY | $( pwd -P )/data | Path where Neo4j writes its data to (outside tools dir) | -RUNTIME_DIRECTORY | $( pwd -P )/runtime | Path where Neo4j puts runtime data to (e.g. logs) (outside tools dir) | -NEO4J_HTTP_PORT | 7474 | Neo4j HTTP API port for executing queries | -NEO4J_HTTPS_PORT | 7473 | Neo4j HTTPS port for encrypted querying | -NEO4J_BOLT_PORT | 7687 | Neo4j's own "Bolt Protocol" port | -NEO4J_CONFIG_TEMPLATE | template-neo4j.conf | Name of the template file ("configuration" folder) for the Neo4j configuration. Defaults to "template-neo4j.conf". | -ARTIFACTS_CHANGE_DETECTION_HASH_FILE | artifactsChangeDetectionHash.txt | !DEPRECATED! Use CHANGE_DETECTION_HASH_FILE. | -CHANGE_DETECTION_HASH_FILE_PATH | ./${ARTIFACTS_DIRECTORY}/${CHANGE_DETECTION_HASH_FILE} | Default path of the file that contains the hash code of the file list for change detection. Can be overridden by a command line option. | -ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION | | Enable PDF generation for Jupyter Notebooks if set to any non empty value like "true" or disable it with "" or "false". | -JUPYTER_OUTPUT_FILE_POSTFIX | | e.g. "" (no postfix), ".nbconvert" or ".output" | -REPORTS_DIRECTORY | reports | | -REPORTS_SCRIPT_DIR | ${SCRIPTS_DIR}/reports | Repository directory containing the report scripts | -CYPHER_DIR | ${SCRIPTS_DIR}/../cypher | | -MARKDOWN_SCRIPTS_DIR | ${SCRIPTS_DIR}/markdown | | -NEO4J_HTTP_TRANSACTION_ENDPOINT | db/neo4j/tx/commit | Since Neo4j v5: "db//tx/commit", Neo4j v4: "db/data/transaction/commit" | -IMPORT_DIRECTORY | import | | -IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT | plugin | Select how to import git log data. Options: "none", "aggregated", "full" and "plugin". Default="plugin". | -NEO4J_APOC_PLUGIN_VERSION | 2026.01.4 | | -NEO4J_APOC_PLUGIN_EDITION | core | | -NEO4J_APOC_PLUGIN_GITHUB | neo4j/apoc | | -NEO4J_GDS_PLUGIN_VERSION | 2.27.0 | | -NEO4J_OPEN_GDS_PLUGIN_VERSION | 2.26.0 | | -NEO4J_GDS_PLUGIN_EDITION | open | | -JQASSISTANT_CLI_VERSION | 2.9.0 | | -JQASSISTANT_CLI_ARTIFACT | jqassistant-commandline-neo4jv5 | | -JQASSISTANT_CONFIG_TEMPLATE | template-neo4jv5-jqassistant-continue-on-error.yaml | | -programmingLanguage | Java | Set to default value "Java" if not set since it is optional | -NEO4J_INITIAL_PASSWORD | | Neo4j login password that was set to replace the temporary initial password | -TOOLS_DIRECTORY | tools | Get the tools directory (defaults to "tools") | -TYPESCRIPT_SCAN_HEAP_MEMORY | 4096 | Heap memory in megabytes for Typescript scanning with (Node.js process). Defaults to 4096 MB. | -JQASSISTANT_CLI_DOWNLOAD_URL | https://repo1.maven.org/maven2/com/buschmais/jqassistant/cli | Download URL for the jQAssistant CLI | -JQASSISTANT_CLI_DISTRIBUTION | distribution.zip | Neo4j v5 & v4: "distribution.zip" | -IGNORED_JARS_DIRECTORY | ./../ignored-jars | Directory to move the filtered out .jar files to | diff --git a/scripts/SCRIPTS.md b/scripts/SCRIPTS.md deleted file mode 100644 index 8c080085b..000000000 --- a/scripts/SCRIPTS.md +++ /dev/null @@ -1,98 +0,0 @@ -# Scripts Reference - -This document serves as a reference for all scripts in the current directory and its subdirectories. -It provides a table listing each script file and its corresponding description found in the first comment line. -This file was generated with the script [generateScriptReference.sh](./generateScriptReference.sh). - -Script | Directory | Description --------|-----------|------------ -| [activateCondaEnvironment.sh](./activateCondaEnvironment.sh) | | Activates the Conda (Python package manager) environment "codegraph" with all packages needed to run the included Jupyter Notebooks and Python scripts. | -| [activatePythonEnvironment.sh](./activatePythonEnvironment.sh) | | Activates the .venv environment (Python build-in virtual environments) with all packages necessary to run the included Jupyter Notebooks and Python scripts. | -| [analyze.sh](./analysis/analyze.sh) | analysis | Coordinates the end-to-end analysis process, encompassing tool installation, graph generation, and report generation. | -| [checkCompatibility.sh](./checkCompatibility.sh) | | Check environment dependencies and tool availability. | -| [cleanupAfterReportGeneration.sh](./cleanupAfterReportGeneration.sh) | | Cleans up after report generation. This includes deleting empty files or in case no file is left deleting the report folder. | -| [cloneGitRepository.sh](./cloneGitRepository.sh) | | Provides safe-guarded (security checked parameters) git repository cloning. | -| [configureNeo4j.sh](./configureNeo4j.sh) | | Configures a (local) Neo4j Community Edition Graph Database (https://neo4j.com/download-center/#community). | -| [createAggregatedGitLogCsv.sh](./createAggregatedGitLogCsv.sh) | | Uses git log to create a comma separated values (CSV) file containing aggregated changes, their author name and email address, year and month for all the files that were changed. | -| [createGitLogCsv.sh](./createGitLogCsv.sh) | | Uses git log to create a comma separated values (CSV) file containing all commits, their author, email address, date and all the file names that were changed with it. | -| [detectChangedFiles.sh](./detectChangedFiles.sh) | | Detect changed files in the artifacts directory or in a given list of paths | -| [appendEnvironmentVariables.sh](./documentation/appendEnvironmentVariables.sh) | documentation | Extracts the environment variable declarations including default values from a script file and appends it to a markdown file as table columns. | -| [generateCypherReference.sh](./documentation/generateCypherReference.sh) | documentation | Generates "CYPHER.md" containing a reference to all Cypher files in this directory and its subdirectories. | -| [generateEnvironmentVariableReference.sh](./documentation/generateEnvironmentVariableReference.sh) | documentation | Runs "appendEnvironmentVariable.sh" for every script file in the current directory and its sub directories. | -| [generateScriptReference.sh](./documentation/generateScriptReference.sh) | documentation | Generates "SCRIPTS.md" containing a reference to all scripts in this directory and its subdirectories. | -| [download.sh](./download.sh) | | Downloads a file into the directory of the environment variable SHARED_DOWNLOADS_DIRECTORY (or default "../downloads"). | -| [downloadMavenArtifact.sh](./downloadMavenArtifact.sh) | | Downloads an artifact from Maven Central (https://mvnrepository.com/repos/central) | -| [downloadMavenArtifacts.sh](./downloadMavenArtifacts.sh) | | Uses Maven to download specified Maven artifacts from Maven Central. | -| [downloadAntDesign.sh](./downloader/downloadAntDesign.sh) | downloader | Downloads the Typescript project ant-design (https://github.com/ant-design/ant-design) from GitHub using git clone. | -| [downloadAxonFramework.sh](./downloader/downloadAxonFramework.sh) | downloader | Downloads AxonFramework (https://developer.axoniq.io/axon-framework) artifacts from Maven Central. | -| [downloadReactRouter.sh](./downloader/downloadReactRouter.sh) | downloader | Downloads react-router (https://github.com/remix-run/react-router) from GitHub using git clone. | -| [downloadTypescriptProject.sh](./downloader/downloadTypescriptProject.sh) | downloader | Downloads the given version of a Typescript project from a git repository using git clone. | -| [analyzeAntDesign.sh](./examples/analyzeAntDesign.sh) | examples | This is an example for the analysis of a the Typescript project "ant-design". | -| [analyzeAxonFramework.sh](./examples/analyzeAxonFramework.sh) | examples | This is an example for the analysis of the Java event-sourcing library "AxonFramework". | -| [analyzeReactRouter.sh](./examples/analyzeReactRouter.sh) | examples | This is an example for the analysis of a the Typescript project "react-router". | -| [detectLatestGitTag.sh](./examples/detectLatestGitTag.sh) | examples | Returns the latest tag of a remote repository given by its url. | -| [executeJupyterNotebook.sh](./executeJupyterNotebook.sh) | | Executes all steps in the given Jupyter Notebook (ipynb), stores it and converts it to Markdown (md) and PDF. | -| [executeJupyterNotebookReport.sh](./executeJupyterNotebookReport.sh) | | Executes the given Jupyter Notebook and puts all resulting files (ipynb, md, pdf) into an accordingly named directory within the "results" directory. | -| [executeQuery.sh](./executeQuery.sh) | | Utilizes Neo4j's HTTP API to execute a Cypher query from an input file and provides the results in CSV format. | -| [executeQueryFunctions.sh](./executeQueryFunctions.sh) | | Provides functions to execute Cypher queries using either "executeQuery.sh" or Neo4j's "cypher-shell". | -| [findPathsToScan.sh](./findPathsToScan.sh) | | Finds all files and directories to scan and analyze and provides them as comma-separated list. | -| [importGit.sh](./importGit.sh) | | Coordinates the import of git data from the given --source directory where one ore more git repositories are located and the value of the environment variable IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT. | -| [installJavaScriptDependencies.sh](./installJavaScriptDependencies.sh) | | This script triggers the installation of dependencies for JavaScript projects in the source folder. | -| [embedMarkdownIncludes.sh](./markdown/embedMarkdownIncludes.sh) | markdown | Processes template markdown (sysin) replacing placeholders like "" or "" with the contents of the specified markdown files. The files to include needs to be in the "includes" subdirectory. | -| [formatQueryResultAsMarkdownTable.sh](./markdown/formatQueryResultAsMarkdownTable.sh) | markdown | Takes the input stream (Cypher query result in JSON format) and formats it as a Markdown table. | -| [testEmbedMarkdownIncludes.sh](./markdown/testEmbedMarkdownIncludes.sh) | markdown | Tests template processing for markdown by embedding includes. | -| [testFormatQueryResultAsMarkdownTable.sh](./markdown/testFormatQueryResultAsMarkdownTable.sh) | markdown | Tests formatting of Cypher query results as Markdown table. | -| [operatingSystemFunctions.sh](./operatingSystemFunctions.sh) | | Provides operating system dependent functions e.g. to detect Windows. | -| [parseCsvFunctions.sh](./parseCsvFunctions.sh) | | Provides functions to parse strings in CSV format. | -| [prepareAnalysis.sh](./prepareAnalysis.sh) | | Prepares and validates the graph database before analysis | -| [Default.sh](./profiles/Default.sh) | profiles | Sets (if any) settings variables for a default analysis. | -| [Neo4j-latest-continue-on-scan-errors.sh](./profiles/Neo4j-latest-continue-on-scan-errors.sh) | profiles | Sets all settings variables for an analysis with the latest version of Neo4j. | -| [Neo4j-latest-high-memory.sh](./profiles/Neo4j-latest-high-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). | -| [Neo4j-latest-low-memory-continue-on-scan-errors.sh](./profiles/Neo4j-latest-low-memory-continue-on-scan-errors.sh) | profiles | Sets all settings variables for a low memory, continue-on-error analysis with the latest version of Neo4j. | -| [Neo4j-latest-low-memory.sh](./profiles/Neo4j-latest-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). | -| [Neo4j-latest.sh](./profiles/Neo4j-latest.sh) | profiles | Sets all settings variables for an analysis with the latest version of Neo4j. | -| [Neo4jv4-low-memory.sh](./profiles/Neo4jv4-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v4.4.x (long term support (LTS) version as of may 2023). | -| [Neo4jv4.sh](./profiles/Neo4jv4.sh) | profiles | Sets all settings variables for an analysis with Neo4j v4.4.x (long term support (LTS) version as of may 2023). | -| [Neo4jv5-continue-on-scan-errors.sh](./profiles/Neo4jv5-continue-on-scan-errors.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). | -| [Neo4jv5-low-memory.sh](./profiles/Neo4jv5-low-memory.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). | -| [Neo4jv5.sh](./profiles/Neo4jv5.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). | -| [projectionFunctions.sh](./projectionFunctions.sh) | | Provides functions to create and delete Graph Projections for Neo4j Graph Data Science. | -| [ArtifactDependenciesCsv.sh](./reports/ArtifactDependenciesCsv.sh) | reports | Executes "Artifact_Dependencies" Cypher queries to get the "artifact-dependencies-csv" CSV reports. | -| [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. | -| [GitHistoryCsv.sh](./reports/GitHistoryCsv.sh) | reports | Executes "GitLog" Cypher queries to get the "git-history-csv" CSV reports. | -| [JavaCsv.sh](./reports/JavaCsv.sh) | reports | Executes "Java" Cypher queries to get the "java-csv" CSV reports. | -| [NodeEmbeddingsCsv.sh](./reports/NodeEmbeddingsCsv.sh) | reports | Generates node embeddings using the Graph Data Science Library of Neo4j and creates CSV reports. | -| [ObjectOrientedDesignMetricsCsv.sh](./reports/ObjectOrientedDesignMetricsCsv.sh) | reports | Executes "Metrics" Cypher queries to get the "object-oriented-design-metrics-csv" CSV reports. | -| [OverviewCsv.sh](./reports/OverviewCsv.sh) | reports | Executes "Overview" Cypher queries to get the "overview-csv" CSV reports. | -| [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" CSV reports. | -| [AllReports.sh](./reports/compilations/AllReports.sh) | compilations | Runs all report scripts. | -| [CsvReports.sh](./reports/compilations/CsvReports.sh) | compilations | Runs all CSV report scripts (no Python and Chromium required). | -| [DatabaseCsvExportReports.sh](./reports/compilations/DatabaseCsvExportReports.sh) | compilations | Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all" | -| [JupyterReports.sh](./reports/compilations/JupyterReports.sh) | compilations | Runs all Jupyter Notebook report scripts. | -| [MarkdownReports.sh](./reports/compilations/MarkdownReports.sh) | compilations | Runs all Markdown report scripts (no Chromium required, no Python required). | -| [PythonReports.sh](./reports/compilations/PythonReports.sh) | compilations | Runs all Python report scripts (no Chromium required). | -| [VisualizationReports.sh](./reports/compilations/VisualizationReports.sh) | compilations | Runs all Visualization reports. | -| [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 "detectChangedFiles.sh" returns detected changes. | -| [runTests.sh](./runTests.sh) | | Runs all test scripts (no Python and Chromium required). | -| [scanTypescript.sh](./scanTypescript.sh) | | Executes the npm package @jqassistant/ts-lc using npx to scan the Typescript projects in the source directory and create an intermediate json data file for the jQAssistant Typescript plugin. | -| [setupJQAssistant.sh](./setupJQAssistant.sh) | | Installs (download and unzip) jQAssistant (https://jqassistant.github.io/jqassistant/current). | -| [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). | -| [sortOutExternalJavaJarFiles.sh](./sortOutExternalJavaJarFiles.sh) | | Sorts out jar files that don't contain one of the given package names (e.g. external libraries) and moves them into the IGNORED_JARS_DIRECTORY. | -| [startNeo4j.sh](./startNeo4j.sh) | | Starts the local Neo4j Graph Database. | -| [stopNeo4j.sh](./stopNeo4j.sh) | | Stops the local Neo4j Graph Database. | -| [testAnalyzeDomainOption.sh](./testAnalyzeDomainOption.sh) | | Tests "--domain" command line option of "analyze.sh". | -| [testCloneGitRepository.sh](./testCloneGitRepository.sh) | | Tests "cloneGitRepository.sh". | -| [testConfigureNeo4j.sh](./testConfigureNeo4j.sh) | | Tests "configureNeo4j.sh". | -| [testDetectChangedFiles.sh](./testDetectChangedFiles.sh) | | Tests "detectChangedFiles.sh". | -| [testDownloadMavenArtifacts.sh](./testDownloadMavenArtifacts.sh) | | Tests "downloadMavenArtifacts.sh". | -| [testFilenameReferences.sh](./testFilenameReferences.sh) | | Tests: scan all *.sh files (current directory including subdirectories) | -| [testInstallJavaScriptDependencies.sh](./testInstallJavaScriptDependencies.sh) | | Tests "installJavaScriptDependencies.sh". | -| [useNeo4jHighMemoryProfile.sh](./useNeo4jHighMemoryProfile.sh) | | Use the high memory profile and apply its configuration template on the local | -| [convertQueryResultCsvToGraphVizDotFile.sh](./visualization/convertQueryResultCsvToGraphVizDotFile.sh) | visualization | Converts a Cypher query result in CSV format to a GraphViz DOT (https://graphviz.org/doc/info/lang.html) file for Visualization including layout templates. | -| [renderGraphVizSVG.sh](./visualization/renderGraphVizSVG.sh) | visualization | Renders the given GraphViz file as a SVG image. | -| [visualizeQueryResults.sh](./visualization/visualizeQueryResults.sh) | visualization | Visualizes the Cypher query result (CSV format) using GraphViz and outputs it as SVG image. | -| [waitForNeo4jHttpFunctions.sh](./waitForNeo4jHttpFunctions.sh) | | Waits until the HTTP Transactions API of Neo4j Graph Database is available. | diff --git a/scripts/documentation/appendEnvironmentVariables.sh b/scripts/documentation/appendEnvironmentVariables.sh index 385169b88..da137fbe1 100755 --- a/scripts/documentation/appendEnvironmentVariables.sh +++ b/scripts/documentation/appendEnvironmentVariables.sh @@ -8,13 +8,13 @@ # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail -# Markdown file name -markdownFile="ENVIRONMENT_VARIABLES.md" +SCRIPT_NAME="appendEnvironmentVariables" +MARKDOWN_FILE="ENVIRONMENT_VARIABLES.md" # If the first command line option is "clear" (instead of a filename) then delete the markdown file. -if [[ "$1" == "clear" ]] ; then - echo "findEnvironmentVariables: Clear existing ${markdownFile}..." - rm -f "${markdownFile}" || echo "findEnvironmentVariables: Error: Failed to remove ${markdownFile}." || exit 1 +if [ "$1" = "clear" ] ; then + echo "${SCRIPT_NAME}: Clear existing ${MARKDOWN_FILE}..." + rm -f "${MARKDOWN_FILE}" || { echo "${SCRIPT_NAME}: Error: Failed to remove ${MARKDOWN_FILE}."; return 1; } return 0 fi @@ -23,50 +23,65 @@ filePath="$1" # Check if the given file exists if [ -z "${filePath}" ] ; then - echo "findEnvironmentVariables: Please provide a file name." - exit 1 + echo "${SCRIPT_NAME}: Please provide a file name." + return 1 fi # Check if the given file exists if [ ! -f "./${filePath}" ] ; then - echo "findEnvironmentVariables: File ${filePath} doesn't exist." - exit 1 + echo "${SCRIPT_NAME}: File ${filePath} doesn't exist." + return 1 fi # Create the markdown file if it doesn't exist with the header of the table -if [ ! -f "./${markdownFile}" ] ; then - echo "findEnvironmentVariables: Creating ${markdownFile}..." +if [ ! -f "./${MARKDOWN_FILE}" ] ; then + echo "${SCRIPT_NAME}: Creating ${MARKDOWN_FILE}..." { echo "# Environment Variables Reference" echo "" echo "This document serves as a reference for all environment variables that are supported by the script files." echo "It provides a table listing each environment variable, its default value and its corresponding description provided as a inline comment." - echo "This file was generated with the script [appendEnvironmentVariables.sh](./appendEnvironmentVariables.sh) and [generateEnvironmentVariableReference.sh](./generateEnvironmentVariableReference.sh)." + echo "This file was generated with the script [appendEnvironmentVariables.sh](./scripts/documentation/appendEnvironmentVariables.sh) and [generateEnvironmentVariableReference.sh](./scripts/documentation/generateEnvironmentVariableReference.sh)." echo "" - echo "| Environment Variable Name | Default | Description |" - echo "| ----------------------------------- | ----------------------------------- | ------------------------------------------------------ |" - } > ${markdownFile} + echo "Environment Variable Name | Default | Description" + echo "------------------------- | ------- | -----------" + } > ${MARKDOWN_FILE} fi -# Regular expression that extracts the environment variable name (1st group), its default value (2nd group) and its description (3rd group) +# Regular expression that extracts the environment variable name (1st group), its default value (2nd group) +# and its description (3rd group). Keep this strict — we only accept double-quoted literal defaults. regular_expression='^[[:space:]]*([A-Za-z_][A-Za-z0-9_]*)=\$\{[A-Za-z_][A-Za-z0-9_]*:-\"([^\"]*)\"\}[[:space:]]*#*[[:space:]]*(.*)' -environmentVariables=$(\ - # Use grep to find lines with the pattern you specified - grep -E "${regular_expression}" "$filePath" | - # Use sed to extract the variable name and default value - sed -E "s/${regular_expression}/\1;\2;\3/" | - # Use awk to format the output as requested - awk -F ';' '{ printf "%-37s | %-35s | %s |\n", $1, $2, $3 }'\ -) +# Probe first so that "no matches" is not treated as a fatal error, while genuine grep/sed/awk +# failures are still detected and propagated (we rely on `set -o pipefail`). +if grep -q -E "${regular_expression}" "${filePath}"; then + if ! environmentVariables=$( \ + grep -E "${regular_expression}" "${filePath}" | \ + sed -E "s/${regular_expression}/\1;\2;\3/" | \ + awk -F ';' '{ printf "%s | %s | %s\n", $1, $2, $3 }' \ + ); then + echo "${SCRIPT_NAME}: Error: Failed to parse environment variables from ${filePath}." + return 1 + fi +else + grep_exit=$? + if [ "${grep_exit}" -eq 1 ]; then + # No matches found — not an error; continue with empty result set. + environmentVariables="" + else + # grep encountered a real error (exit code 2 or other) — surface it. + echo "${SCRIPT_NAME}: Error: grep failed with exit status ${grep_exit} while scanning ${filePath}." + return 1 + fi +fi # Iterate over each environment variable line by line while IFS= read -r environmentVariable; do # Extract the name of the environment variable out of the markdown table line format. environmentVariableName=$(echo -n "${environmentVariable}" | tr -s " " | cut -d "|" -f 1) # Check if the environment variable is already in the output markdown file. - if ! grep -q "${environmentVariableName}" "$markdownFile"; then + if ! grep -q "${environmentVariableName}" "${MARKDOWN_FILE}"; then # Append the previously found environment variable to the markdown file since it isn't in there yet. - echo "${environmentVariable}" >> ${markdownFile} + echo "${environmentVariable}" >> ${MARKDOWN_FILE} fi -done <<< "$environmentVariables" \ No newline at end of file +done <<< "$environmentVariables" diff --git a/scripts/documentation/generateCypherReference.sh b/scripts/documentation/generateCypherReference.sh index b8a86f02d..250a7d3ca 100755 --- a/scripts/documentation/generateCypherReference.sh +++ b/scripts/documentation/generateCypherReference.sh @@ -1,28 +1,32 @@ #!/usr/bin/env bash -# Generates "CYPHER.md" containing a reference to all Cypher files in this directory and its subdirectories. +# Generates "CYPHER.md" containing a reference to all Cypher files in all directories and subdirectories. +# Note: This script is intended to be run from the repository root. # This script was generated by Chat-GPT after some messages back and forth and then tuned manually. # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail -# Markdown file name -markdown_file="CYPHER.md" +SCRIPT_NAME="generateCypherReference" -echo "generateCypherReference: Generating ${markdown_file}..." +# Markdown file name (written to repository root) +markdown_file="./CYPHER.md" + +echo "${SCRIPT_NAME}: Generating ${markdown_file}..." { echo "# Cypher Reference" echo "" - echo "This document serves as a reference for all Cypher files in the current directory and its subdirectories." + echo "This document serves as a reference for all Cypher files in the repository and its subdirectories." echo "It provides a table listing each Cypher file and its corresponding description found in the first comment line." - echo "This file was generated with the script [generateCypherReference.sh](./../scripts/documentation/generateCypherReference.sh)." + echo "This file was generated with the script [${SCRIPT_NAME}.sh](./scripts/documentation/${SCRIPT_NAME}.sh)." echo "" echo "Script | Directory | Description" echo "-------|-----------|------------" } > ${markdown_file} -find . -type f -name "*.cypher" | sort | while read -r cypher_file; do +# Loop through all Cypher files in the current directory and all subdirectories, excluding "temp" and ".github" directories +find . -type d -name "temp" -prune -o -type f -name "*.cypher" -print | sort | while read -r cypher_file; do # Read the contents of the Cypher file cypher_file_contents=$(cat "$cypher_file") @@ -46,4 +50,4 @@ find . -type f -name "*.cypher" | sort | while read -r cypher_file; do echo "| ${link} | ${last_path_segment%%.} | ${description//|/\\|} |" >> ${markdown_file} done -echo "generateCypherReference: Successfully generated ${markdown_file}." \ No newline at end of file +echo "${SCRIPT_NAME}: Successfully generated ${markdown_file}." \ No newline at end of file diff --git a/scripts/documentation/generateEnvironmentVariableReference.sh b/scripts/documentation/generateEnvironmentVariableReference.sh index 32deb7663..d03d2a4e4 100755 --- a/scripts/documentation/generateEnvironmentVariableReference.sh +++ b/scripts/documentation/generateEnvironmentVariableReference.sh @@ -1,28 +1,36 @@ #!/usr/bin/env bash -# Runs "appendEnvironmentVariable.sh" for every script file in the current directory and its sub directories. +# Runs "appendEnvironmentVariables.sh" for every script file in all directories and subdirectories. +# Note: This script is intended to be run from the repository root. -# Requires appendEnvironmentVariable.sh +# Requires appendEnvironmentVariables.sh # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail -## Get this "scripts" directory if not already set +## Get this "scripts/documentation" directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. +SCRIPT_NAME="generateEnvironmentVariableReference" DOCUMENTATION_SCRIPTS_DIR=${DOCUMENTATION_SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the documentation generation scripts -echo "generateEnvironmentVariablesReference: DOCUMENTATION_SCRIPTS_DIR=${DOCUMENTATION_SCRIPTS_DIR}" +# echo "${SCRIPT_NAME}: DOCUMENTATION_SCRIPTS_DIR=${DOCUMENTATION_SCRIPTS_DIR}" -echo "generateEnvironmentVariableReference: Generating ENVIRONMENT_VARIABLES.md..." +echo "${SCRIPT_NAME}: Generating ENVIRONMENT_VARIABLES.md..." # Clear existing markdown document -source "${DOCUMENTATION_SCRIPTS_DIR}/appendEnvironmentVariables.sh" "clear" || exit 1 - -# Loop through all script files in the current directory -find . -type f -name "*.sh" | sort | while read -r scriptFile; do - echo "generateEnvironmentVariablesReference: Searching for environment variables in ${scriptFile}" - source "${DOCUMENTATION_SCRIPTS_DIR}/appendEnvironmentVariables.sh" "${scriptFile}" || exit 1 +if ! source "${DOCUMENTATION_SCRIPTS_DIR}/appendEnvironmentVariables.sh" "clear"; then + echo "generateEnvironmentVariableReference: Error: Failed to clear existing ENVIRONMENT_VARIABLES.md." + exit 1 +fi + +# Loop through all script files in the current directory and all subdirectories +find . -type d -name "temp" -prune -o -type f -name "*.sh" -print | sort | while read -r scriptFile; do + # echo "${SCRIPT_NAME}: Searching for environment variables in ${scriptFile}" + if ! source "${DOCUMENTATION_SCRIPTS_DIR}/appendEnvironmentVariables.sh" "${scriptFile}" 2>&1; then + echo "generateEnvironmentVariableReference: Error: Failed to extract environment variables from ${scriptFile}." + exit 1 + fi done -echo "generateEnvironmentVariableReference: Successfully generated ENVIRONMENT_VARIABLES.md." \ No newline at end of file +echo "${SCRIPT_NAME}: Successfully generated ENVIRONMENT_VARIABLES.md." \ No newline at end of file diff --git a/scripts/documentation/generateScriptReference.sh b/scripts/documentation/generateScriptReference.sh index 3a04a5ac8..fefb8bdea 100755 --- a/scripts/documentation/generateScriptReference.sh +++ b/scripts/documentation/generateScriptReference.sh @@ -1,29 +1,37 @@ #!/usr/bin/env bash -# Generates "SCRIPTS.md" containing a reference to all scripts in this directory and its subdirectories. +# Generates "SCRIPTS.md" containing a reference to all scripts in all directories and subdirectories. +# Note: This script is intended to be run from the repository root. # This script was generated by Chat-GPT after some messages back and forth and then tuned manually. # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail -# Markdown file name -markdown_file="SCRIPTS.md" +## Get this "scripts/documentation" directory if not already set +# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. +# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. +# This way non-standard tools like readlink aren't needed. +SCRIPT_NAME="generateScriptReference" +DOCUMENTATION_SCRIPTS_DIR=${DOCUMENTATION_SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the documentation generation scripts -echo "generateScriptReference: Generating ${markdown_file}..." +# Markdown file name (written to scripts directory) +markdown_file="./SCRIPTS.md" + +echo "${SCRIPT_NAME}: Generating ${markdown_file}..." { echo "# Scripts Reference" echo "" - echo "This document serves as a reference for all scripts in the current directory and its subdirectories." + echo "This document serves as a reference for all scripts in the repository and its subdirectories." echo "It provides a table listing each script file and its corresponding description found in the first comment line." - echo "This file was generated with the script [generateScriptReference.sh](./generateScriptReference.sh)." + echo "This file was generated with the script [${SCRIPT_NAME}.sh](./scripts/documentation/${SCRIPT_NAME}.sh)." echo "" echo "Script | Directory | Description" - echo "-------|-----------|------------" + echo "------ | --------- | -----------" } > ${markdown_file} -# Loop through all script files in the current directory -find . -type f -name "*.sh" | sort | while read -r script_file; do +# Loop through all script files in the current directory and all subdirectories, excluding "temp" and ".github" directories +find -L . \( -type d -name "temp" -o -type d -name ".github" \) -prune -o -type f -name "*.sh" -print | sort | while read -r script_file; do # Get the description of the script file description=$(awk 'NR>1 && /^ *#/{sub(/^ *# ?/,""); print; exit}' "$script_file") @@ -38,7 +46,7 @@ find . -type f -name "*.sh" | sort | while read -r script_file; do link="[${filename}](${script_file})" # Add the script file and its description to the Markdown table - echo "| ${link} | ${last_path_segment%%.} | ${description//|/\\|} |" >> ${markdown_file} + echo "${link} | ${last_path_segment%%.} | ${description//|/\\|}" >> ${markdown_file} done -echo "generateScriptReference: Successfully generated ${markdown_file}." \ No newline at end of file +echo "${SCRIPT_NAME}: Successfully generated ${markdown_file}." \ No newline at end of file From 593815b7068f026c7a948360f59c46440c859674 Mon Sep 17 00:00:00 2001 From: JohT <7671054+JohT@users.noreply.github.com> Date: Sun, 12 Apr 2026 09:14:11 +0200 Subject: [PATCH 2/2] Introduce neo4j-management domain --- .../plan-neo4jManagementDomain.prompt.md | 116 ++++++++++++ .github/skills/neo4j-management/SKILL.md | 169 ++++++++++++++++++ .../references/troubleshooting.md | 68 +++++++ CHANGELOG.md | 16 ++ COMMANDS.md | 18 +- README.md | 2 +- domains/neo4j-management/README.md | 86 +++++++++ .../template-neo4j-high-memory.conf | 0 .../template-neo4j-low-memory.conf | 0 .../template-neo4j-v4-low-memory.conf | 0 .../configuration/template-neo4j-v4.conf | 0 .../configuration/template-neo4j.conf | 0 .../neo4j-management}/configureNeo4j.sh | 13 +- domains/neo4j-management/detectNeo4j.sh | 62 +++++++ .../neo4j-management/detectNeo4jWindows.sh | 129 +++++++++++++ .../neo4j-management}/setupNeo4j.sh | 9 +- .../setupNeo4jInitialPassword.sh | 7 +- domains/neo4j-management/startNeo4j.sh | 110 ++++++++++++ domains/neo4j-management/stopNeo4j.sh | 110 ++++++++++++ .../neo4j-management}/testConfigureNeo4j.sh | 41 +++-- .../useNeo4jHighMemoryProfile.sh | 9 +- .../waitForNeo4jHttpFunctions.sh | 5 +- init.sh | 8 +- scripts/analysis/analyze.sh | 8 +- scripts/runTests.sh | 3 +- scripts/startNeo4j.sh | 112 +----------- scripts/stopNeo4j.sh | 112 +----------- scripts/testAnalyzeDomainOption.sh | 15 +- 28 files changed, 952 insertions(+), 276 deletions(-) create mode 100644 .github/prompts/plan-neo4jManagementDomain.prompt.md create mode 100644 .github/skills/neo4j-management/SKILL.md create mode 100644 .github/skills/neo4j-management/references/troubleshooting.md create mode 100644 domains/neo4j-management/README.md rename {scripts => domains/neo4j-management}/configuration/template-neo4j-high-memory.conf (100%) rename {scripts => domains/neo4j-management}/configuration/template-neo4j-low-memory.conf (100%) rename {scripts => domains/neo4j-management}/configuration/template-neo4j-v4-low-memory.conf (100%) rename {scripts => domains/neo4j-management}/configuration/template-neo4j-v4.conf (100%) rename {scripts => domains/neo4j-management}/configuration/template-neo4j.conf (100%) rename {scripts => domains/neo4j-management}/configureNeo4j.sh (94%) create mode 100755 domains/neo4j-management/detectNeo4j.sh create mode 100755 domains/neo4j-management/detectNeo4jWindows.sh rename {scripts => domains/neo4j-management}/setupNeo4j.sh (94%) rename {scripts => domains/neo4j-management}/setupNeo4jInitialPassword.sh (87%) create mode 100755 domains/neo4j-management/startNeo4j.sh create mode 100755 domains/neo4j-management/stopNeo4j.sh rename {scripts => domains/neo4j-management}/testConfigureNeo4j.sh (86%) rename {scripts => domains/neo4j-management}/useNeo4jHighMemoryProfile.sh (64%) rename {scripts => domains/neo4j-management}/waitForNeo4jHttpFunctions.sh (88%) mode change 100755 => 100644 scripts/startNeo4j.sh mode change 100755 => 100644 scripts/stopNeo4j.sh diff --git a/.github/prompts/plan-neo4jManagementDomain.prompt.md b/.github/prompts/plan-neo4jManagementDomain.prompt.md new file mode 100644 index 000000000..67f22ee8a --- /dev/null +++ b/.github/prompts/plan-neo4jManagementDomain.prompt.md @@ -0,0 +1,116 @@ +# Plan: Introduce neo4j-management Domain + +Create `domains/neo4j-management/` containing all scripts, configs, and tests for installing, configuring, starting, and stopping Neo4j. Move 15 files (10 shell scripts + 5 configuration templates) into the domain. Keep profiles in `scripts/profiles/` and jQAssistant YAML templates in `scripts/configuration/`. Update all references. Create a README with agent-friendly examples. + +--- + +### Phase 1 — Create Domain Structure & Move Files + +1. Create `domains/neo4j-management/` with a `configuration/` subdirectory +2. Move **10 shell scripts** from `scripts/` → `domains/neo4j-management/`: + - [setupNeo4j.sh](domains/neo4j-management/setupNeo4j.sh), [setupNeo4jInitialPassword.sh](domains/neo4j-management/setupNeo4jInitialPassword.sh), [configureNeo4j.sh](domains/neo4j-management/configureNeo4j.sh) *(pre-move locations: `scripts/setupNeo4j.sh`, `scripts/setupNeo4jInitialPassword.sh`, `scripts/configureNeo4j.sh`)* + - [startNeo4j.sh](domains/neo4j-management/startNeo4j.sh), [stopNeo4j.sh](domains/neo4j-management/stopNeo4j.sh) *(pre-move locations: `scripts/startNeo4j.sh`, `scripts/stopNeo4j.sh`)* + - [detectNeo4j.sh](domains/neo4j-management/detectNeo4j.sh), [detectNeo4jWindows.sh](domains/neo4j-management/detectNeo4jWindows.sh) *(pre-move locations: `scripts/detectNeo4j.sh`, `scripts/detectNeo4jWindows.sh`)* + - [waitForNeo4jHttpFunctions.sh](domains/neo4j-management/waitForNeo4jHttpFunctions.sh), [useNeo4jHighMemoryProfile.sh](domains/neo4j-management/useNeo4jHighMemoryProfile.sh) *(pre-move locations: `scripts/waitForNeo4jHttpFunctions.sh`, `scripts/useNeo4jHighMemoryProfile.sh`)* + - [testConfigureNeo4j.sh](domains/neo4j-management/testConfigureNeo4j.sh) *(pre-move location: `scripts/testConfigureNeo4j.sh`)* +3a. Replace the pre-move scripts `scripts/startNeo4j.sh` and `scripts/stopNeo4j.sh` with **minimal redirect stubs** that forward to [domains/neo4j-management/startNeo4j.sh](domains/neo4j-management/startNeo4j.sh) and [domains/neo4j-management/stopNeo4j.sh](domains/neo4j-management/stopNeo4j.sh) for backward compatibility with existing projects that have forwarding scripts pointing to the old location. The stubs must not be referenced by any new code; they exist solely to avoid breaking old workspaces. Each stub contains only: + ```bash + #!/usr/bin/env bash + # Deprecated: moved to domains/neo4j-management/. This stub exists for backward compatibility only. + source "$(dirname -- "${BASH_SOURCE[0]}")/../domains/neo4j-management/$(basename -- "${BASH_SOURCE[0]}")" "${@}" + ``` +3. Move **5 neo4j.conf templates** from `scripts/configuration/` → `domains/neo4j-management/configuration/`: + - `template-neo4j.conf`, `template-neo4j-high-memory.conf`, `template-neo4j-low-memory.conf`, `template-neo4j-v4.conf`, `template-neo4j-v4-low-memory.conf` + +### Phase 2 — Update Internal References (within moved scripts) + +4. Add `NEO4J_MANAGEMENT_DIR` resolution to each moved script (same pattern as `DOMAIN_SCRIPT_DIR` in other domains), keeping a `SCRIPTS_DIR` fallback for shared utilities like `download.sh` and `operatingSystemFunctions.sh` +5. Update `configureNeo4j.sh` — resolve config templates from `domains/neo4j-management/configuration/` instead of `scripts/configuration/` +6. Update `setupNeo4j.sh` — source `configureNeo4j.sh` and `setupNeo4jInitialPassword.sh` from co-located directory +7. Update the moved `startNeo4j.sh` and `stopNeo4j.sh` in the domain — source `waitForNeo4jHttpFunctions.sh` from the co-located directory +8. Update `useNeo4jHighMemoryProfile.sh` — source `configureNeo4j.sh` from co-located directory +9. Update `testConfigureNeo4j.sh` — source `configureNeo4j.sh` from co-located directory + +### Phase 3 — Update External Callers + +10. Update [scripts/analysis/analyze.sh](scripts/analysis/analyze.sh) — source `setupNeo4j.sh`, `startNeo4j.sh`, `stopNeo4j.sh` from `${DOMAINS_DIRECTORY}/neo4j-management/` (already resolves `DOMAINS_DIRECTORY`) *(critical path)* +11. Update [init.sh](init.sh) — change forwarding script paths for `startNeo4j.sh` and `stopNeo4j.sh` from `./../../scripts/` to `./../../domains/neo4j-management/`. The redirect stubs in `scripts/` ensure old workspaces (where `init.sh` was already run before this change) still work without any manual migration. +12. Check [scripts/resetAndScan.sh](scripts/resetAndScan.sh) — references `template-neo4j` for jQAssistant YAML path resolution; verify this is about jQAssistant templates (which stay) not neo4j.conf templates + +### Phase 4 — Update Documentation + +13. Update [COMMANDS.md](COMMANDS.md) — fix links to `setupNeo4j.sh`, `configureNeo4j.sh`, `stopNeo4j.sh`, `useNeo4jHighMemoryProfile.sh`, and configuration template references +14. Update [README.md](README.md) — fix `useNeo4jHighMemoryProfile.sh` usage examples (lines ~304–307) +15. Update [.github/prompts/plan-coding_agent_instructions.prompt.md](.github/prompts/plan-coding_agent_instructions.prompt.md) — fix `startNeo4j.sh` reference +16. Do not change [SCRIPTS.md](SCRIPTS.md) its will be regenerated via `generateScriptReference.sh` +17. Add [CHANGELOG.md](CHANGELOG.md) entry for the domain creation + +### Phase 5 — Verify Renovate Patterns + +18. Verify [renovate.json](renovate.json) — 5 regex managers use `^scripts/profiles/Neo4j-latest.*\\.sh$` and `^scripts/[^/]*\\.sh$`. Since profiles stay in `scripts/profiles/`, no changes needed unless moved scripts contain `NEO4J_VERSION:-` defaults (unlikely — those are in profiles). *Parallel with Phase 4.* + +### Phase 6 — Create README.md + +19. Create `domains/neo4j-management/README.md` with: + - Purpose & scope (install, configure, start, stop Neo4j) + - Prerequisites (Java, `jq`, `NEO4J_INITIAL_PASSWORD`) + - Quick-start examples for setting up, starting, stopping Neo4j + - Environment variables reference + - Configuration templates explanation + - Agent-friendly structured instructions for future AGENTS.md / skill usage + +--- + +### Relevant Files + +**Move (15 files):** 10 scripts from `scripts/` + 5 templates from `scripts/configuration/` (listed above) + +**Create (1 file):** `domains/neo4j-management/README.md` + +**Replace with redirect stubs (2 files):** `scripts/startNeo4j.sh`, `scripts/stopNeo4j.sh` — replaced in-place with minimal stubs that forward to the domain; not deleted + +**Update (9–11 files):** [analyze.sh](scripts/analysis/analyze.sh), [init.sh](init.sh), [scripts/runTests.sh](scripts/runTests.sh), [COMMANDS.md](COMMANDS.md), [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [.github/prompts/plan-coding_agent_instructions.prompt.md](.github/prompts/plan-coding_agent_instructions.prompt.md), possibly [scripts/resetAndScan.sh](scripts/resetAndScan.sh) and [renovate.json](renovate.json) + +**Stay in place:** All 11 profile scripts, 5 jQAssistant YAML templates, all query function scripts, `scripts/startNeo4j.sh` (as stub), `scripts/stopNeo4j.sh` (as stub) + +--- + +### Verification + +1. Update [scripts/runTests.sh](scripts/runTests.sh) — it currently discovers tests with `find "${SCRIPTS_DIR}" -type f -name 'test*.sh'`, searching only the `scripts/` directory. Extend it to also search `domains/` so that `testConfigureNeo4j.sh` in its new location is picked up automatically (and any future domain-level tests are discovered too). +2. Run `./scripts/runTests.sh` from the repository root — verify that `testConfigureNeo4j.sh` is discovered and executed from its new domain location, and that all other tests still pass. +3. Run `shellcheck` on all moved scripts +4. Grep for old paths (`scripts/setupNeo4j|scripts/configureNeo4j|scripts/detectNeo4j|scripts/waitForNeo4j|scripts/useNeo4jHighMemory|scripts/setupNeo4jInitialPassword|scripts/testConfigureNeo4j`) — no stale references should remain. `scripts/startNeo4j.sh` and `scripts/stopNeo4j.sh` are intentionally kept as redirect stubs, so references to them from *outside* this repository (e.g., old workspace forwarding scripts) are expected and acceptable. +5. Verify `init.sh` forwarding scripts point to new locations +6. Verify Renovate regex patterns still match profile files + +--- + +### Decisions + +- **Profiles stay in `scripts/profiles/`** — they also contain jQAssistant settings (separate concern) +- **jQAssistant YAML templates stay in `scripts/configuration/`** — not neo4j-specific +- **No COPIED_FILES.md** — files are moved, not copied (clean cut) +- **testConfigureNeo4j.sh moves** into the domain +- **init.sh paths updated directly** — forwarding scripts created by `init.sh` point to the domain going forward +- **`scripts/startNeo4j.sh` and `scripts/stopNeo4j.sh` replaced with redirect stubs** — they forward to the domain implementation; not referenced by any pipeline code after the change, but kept so old project workspaces (already initialised before this change) continue to work without migration +- **No domain entry-point scripts** (`*Csv.sh`, `*Python.sh`) — this domain is infrastructure, not report generation + +--- + +### Pros and Cons: Moving Query Functions + +The query execution infrastructure (`executeQueryFunctions.sh`, `executeQuery.sh`, `parseCsvFunctions.sh`, `projectionFunctions.sh`) was evaluated for inclusion: + +**Pros of moving:** +- Cohesive grouping — all Neo4j interaction in one place +- Agent-friendly — a single domain to fully operate Neo4j +- Cleaner `scripts/` directory + +**Cons of moving:** +- **30+ consumer files need path changes** — every report script, every domain script, `prepareAnalysis.sh`, `importGit.sh` +- **Cross-domain coupling** — other domains would now depend on neo4j-management, breaking vertical-slice independence where each domain only depends on `scripts/` +- **Mixing concerns** — management (lifecycle) and query execution (runtime API) are different layers +- **No benefit to consumers** — the functions are already a stable, well-abstracted API + +**Recommendation:** Don't move query functions now. Keep neo4j-management focused on lifecycle management. Query functions could become a separate `neo4j-query-api` domain later if desired. diff --git a/.github/skills/neo4j-management/SKILL.md b/.github/skills/neo4j-management/SKILL.md new file mode 100644 index 000000000..59bc5e895 --- /dev/null +++ b/.github/skills/neo4j-management/SKILL.md @@ -0,0 +1,169 @@ +--- +name: neo4j-management +description: "Manage a local Neo4j database for code graph analysis. Use when: starting Neo4j, stopping Neo4j, detecting if Neo4j is running, checking Neo4j status, answering 'Is Neo4j running?', 'Is Neo4j currently running?', 'where is Neo4j running?', increasing Neo4j memory, switching analysis workspace, troubleshooting Neo4j, setting up Neo4j." +argument-hint: "is neo4j running | detect | start [workspace] | stop | memory | setup" +--- + +# Neo4j Management + +Manage the local Neo4j graph database lifecycle: detect, start, stop, reconfigure memory. + +**Quick reference:** + +| Action | Script | Typical trigger | +|--------|--------|-----------------| +| Detect | `detectNeo4j.sh` / `detectNeo4jWindows.sh` | First step always | +| Start | `startNeo4j.sh` | Neo4j not running | +| Stop | `stopNeo4j.sh` | Free resources, switch workspace | +| Memory | `useNeo4jHighMemoryProfile.sh` | Out-of-memory or slow queries | +| Setup | Use `analyze.sh` (see [GETTING_STARTED](../../GETTING_STARTED.md)) | New installation | + +## When to Use + +- User asks to start, stop, or check on Neo4j +- User wants to switch to a different analysis workspace +- User runs into memory issues (heap, page cache) and wants to increase Neo4j memory +- User asks to set up or install Neo4j + +## Domain Scripts + +The scripts live in `domains/neo4j-management/`. **Detection scripts** (`detectNeo4j.sh`, `detectNeo4jWindows.sh`) inspect the process table and can be run from **any directory**, including the repository root. **Start/stop/configure scripts** must be run from the **analysis workspace directory** (e.g. `temp/my-project`). + +| Script | Purpose | +|--------|---------| +| `detectNeo4j.sh` | Detect if Neo4j is running (Linux/macOS) | +| `detectNeo4jWindows.sh` | Detect if Neo4j is running (WSL/Git Bash on Windows) | +| `startNeo4j.sh` | Start Neo4j and wait until queryable | +| `stopNeo4j.sh` | Stop Neo4j gracefully | +| `useNeo4jHighMemoryProfile.sh` | Reconfigure with high-memory template | +| `configureNeo4j.sh` | Apply a configuration template | + +### Internal scripts — do NOT use directly + +- `setupNeo4jInitialPassword.sh` +- `waitForNeo4jHttpFunctions.sh` +- `testConfigureNeo4j.sh` + +## Procedure + +### Step 1 — Detect if Neo4j Is Running + +Always run the detect script first — do **not** attempt to read processes, ports, or any other signals manually before the script has been executed. + +Determine the operating system. On **Windows** (WSL / Git Bash), run: + +```shell +./domains/neo4j-management/detectNeo4jWindows.sh +``` + +On **Linux or macOS**, run: + +```shell +./domains/neo4j-management/detectNeo4j.sh +``` + +If the script produces no output at all, run it a **second time** before drawing any conclusions. Only if the second run also returns nothing, treat it as equivalent to `Neo4j not running`. + +The output is one of: + +- `Neo4j not running` +- `Neo4j running in (workspace: )` — workspace successfully identified +- `Neo4j running in ` — path found but workspace could not be derived +- `Neo4j running in (path undetermined)` — Neo4j is running but the path could not be read + +#### Workspace identified `(workspace: )` + +The analysis workspace directory is the path **before** the `/tools` segment. For example, if the path is `/Users/me/repo/temp/my-project/tools/neo4j-community-2026.01.4`, the workspace is `/Users/me/repo/temp/my-project`. Inform the user and `cd` into that directory. + +#### Path found but no workspace in parentheses + +Neo4j is running outside the standard `temp//tools/...` layout. +Ask the user if they know the workspace directory. If yes, `cd` into it and continue. +If no — see [Troubleshooting guide](./references/troubleshooting.md) for manual stop and kill commands. + +#### Path undetermined + +Neo4j is running but the path cannot be read. Ask the user to run: + +```shell +ps -eo pid,command | grep -i neo4j | grep -v grep +``` + +Once the path is identified, follow the "Path found" branch above or the [Troubleshooting guide](./references/troubleshooting.md). + +### Step 2 — Decide Based on User Intent and Neo4j State + +#### Neo4j is NOT running + user wants to start it + +1. Ask the user which analysis workspace to use (e.g. `temp/my-project`) if not already known. +2. `cd` into the analysis workspace directory. +3. Prompt the user for the Neo4j password: + > "What is your `NEO4J_INITIAL_PASSWORD`? (You can skip this if you prefer to set it yourself in the terminal — just type `skip` or press Enter.)" + + - If the user provides a password, generate the export command: + ```shell + export NEO4J_INITIAL_PASSWORD= + ``` + - If the user skips, remind them to run the export themselves before starting: + > "Please run `export NEO4J_INITIAL_PASSWORD=` in your terminal before starting Neo4j." +4. Start Neo4j: + ```shell + ./startNeo4j.sh + ``` + +#### Neo4j IS running + user wants to start a DIFFERENT workspace + +**Strongly warn the user**: running two analysis workspaces against the same Neo4j instance corrupts data by mixing results from different projects. + +Recommend stopping the current analysis first: + +```shell +cd +./stopNeo4j.sh +``` + +Only proceed with starting the new workspace after the user confirms they have stopped the old one. + +#### Neo4j IS running + user wants to stop it + +`cd` into the workspace where Neo4j is running, then: + +```shell +./stopNeo4j.sh +``` + +#### User reports memory issues + +Apply the high-memory configuration template. Neo4j must be **stopped** first. + +```shell +cd +./stopNeo4j.sh +./useNeo4jHighMemoryProfile.sh +./startNeo4j.sh +``` + +### Step 3 — Setup / Installation Requests + +> **Always recommend using `analyze.sh` first.** It handles download, installation, configuration, start, and stop automatically via profiles. Point the user to the [GETTING_STARTED guide](../../GETTING_STARTED.md). + +Only assist with a manual `setupNeo4j.sh` invocation if the user can explain a concrete reason why the automated `analyze.sh` workflow does not fit their needs (e.g. custom Neo4j version, enterprise edition, non-standard directory layout). + +## Environment Variables + +All are set automatically by `analyze.sh` in normal runs. For manual operation: + +| Variable | Default | Required | +|----------|---------|----------| +| `NEO4J_INITIAL_PASSWORD` | — | **Yes** | +| `NEO4J_VERSION` | `2026.01.4` | No | +| `NEO4J_EDITION` | `community` | No | +| `NEO4J_HTTP_PORT` | `7474` | No | +| `TOOLS_DIRECTORY` | `tools` | No | + +## Important Warnings + +- **Stop Neo4j before switching projects.** Data from different projects will mix in the same database instance otherwise. +- **`NEO4J_INITIAL_PASSWORD` must be set** before starting or setting up Neo4j. +- Scripts expect to be run from the analysis workspace directory (where the `tools/` folder lives). +- **Docker is not supported.** Detection and management scripts rely on native process inspection (`ps`) and do not detect or manage Neo4j running inside a Docker container. diff --git a/.github/skills/neo4j-management/references/troubleshooting.md b/.github/skills/neo4j-management/references/troubleshooting.md new file mode 100644 index 000000000..c6050fedb --- /dev/null +++ b/.github/skills/neo4j-management/references/troubleshooting.md @@ -0,0 +1,68 @@ +# Neo4j Management — Troubleshooting + +Reference for edge cases where Neo4j is running but the analysis workspace cannot be determined automatically. + +## Path found but workspace unknown + +Neo4j is running in a path that does not follow the standard `temp//tools/...` layout. + +**Step 1:** Ask the user: + +> "Neo4j is running in `` but I could not determine the analysis workspace automatically. Do you know which workspace directory this belongs to?" + +- If the user provides the workspace → `cd` into it and continue normally with `startNeo4j.sh` / `stopNeo4j.sh`. + +**Step 2:** If the user does not know or says Neo4j is running outside the pipeline, help with manual control: + +Locate the `bin/` directory inside the detected path (contains `neo4j` or `neo4j.bat`), then: + +```shell +# Stop (Linux/macOS) +NEO4J_HOME= /bin/neo4j stop + +# Stop (Windows, Git Bash or CMD) +\bin\neo4j.bat stop +``` + +If the command above fails: + +```shell +# Linux/macOS — find the PID and send SIGTERM +kill $(ps -eo pid,command | grep -i neo4j | grep -v grep | awk '{print $1}') + +# Force kill if process does not stop after ~30 s +kill -9 $(ps -eo pid,command | grep -i neo4j | grep -v grep | awk '{print $1}') +``` + +```powershell +# Windows PowerShell — find and stop Neo4j process +Get-CimInstance Win32_Process -Filter "Name='java.exe'" | + Where-Object { $_.CommandLine -like '*neo4j*' } | + Select-Object -ExpandProperty ProcessId | + Stop-Process -Id +``` + +## Path undetermined + +Neo4j is running but the detect script could not read the path from the process. + +**Step 1:** Ask the user to run the appropriate command to find the process: + +```shell +# Linux/macOS +ps -eo pid,command | grep -i neo4j | grep -v grep +``` + +```powershell +# Windows PowerShell +Get-CimInstance Win32_Process -Filter "Name='java.exe'" | + Where-Object { $_.CommandLine -like '*neo4j*' } | + Select-Object ProcessId, CommandLine +``` + +**Step 2:** From the command output help the user identify the Neo4j home path: +- Look for `--home-dir=` in the command line (Neo4j 5+) +- Or `-Dneo4j.home=` (Neo4j 4) +- Or a classpath entry ending in `/lib/*` — strip `/lib/*` to get the home + +**Step 3:** Once the path is known, follow the "Path found but workspace unknown" section above. diff --git a/CHANGELOG.md b/CHANGELOG.md index 003889b7a..44ee169be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ This document describes the changes to the Code Graph Analysis Pipeline. The changes are grouped by version and date. The latest version is at the top. +## (unreleased) Introduce neo4j-management domain + +### ✨ Highlight + +* Introduce `domains/neo4j-management/` as a vertical-slice domain that owns all Neo4j lifecycle management (install, configure, start, stop). + +### 🚀 Features + +* Move Neo4j management scripts from `scripts/` to `domains/neo4j-management/`: + `setupNeo4j.sh`, `setupNeo4jInitialPassword.sh`, `configureNeo4j.sh`, `startNeo4j.sh`, `stopNeo4j.sh`, + `detectNeo4j.sh`, `detectNeo4jWindows.sh`, `waitForNeo4jHttpFunctions.sh`, `useNeo4jHighMemoryProfile.sh`, `testConfigureNeo4j.sh` +* Move Neo4j configuration templates from `scripts/configuration/` to `domains/neo4j-management/configuration/`: + `template-neo4j.conf`, `template-neo4j-high-memory.conf`, `template-neo4j-low-memory.conf`, `template-neo4j-v4.conf`, `template-neo4j-v4-low-memory.conf` +* Keep `scripts/startNeo4j.sh` and `scripts/stopNeo4j.sh` as **backward-compatible redirect stubs** so existing analysis workspaces continue to work without migration. +* Extend `runTests.sh` to also discover and run test scripts in `domains/` subdirectories. + ## v3.5.0 Select analysis domain and npm dev dependency awareness ### ✨ Highlight diff --git a/COMMANDS.md b/COMMANDS.md index a5a9419f2..877699eb9 100644 --- a/COMMANDS.md +++ b/COMMANDS.md @@ -12,6 +12,8 @@ - [Start an analysis with PDF generation](#start-an-analysis-with-pdf-generation) - [Start an analysis without importing git log data](#start-an-analysis-without-importing-git-log-data) - [Only run setup and explore the Graph manually](#only-run-setup-and-explore-the-graph-manually) + - [Only run the reports of one specific domain](#only-run-the-reports-of-one-specific-domain) + - [Only run the CSV reports of one specific domain](#only-run-the-csv-reports-of-one-specific-domain) - [Generate Markdown References](#generate-markdown-references) - [Generate Cypher Reference](#generate-cypher-reference) - [Generate Script Reference](#generate-script-reference) @@ -78,11 +80,11 @@ The [analyze.sh](./scripts/analysis/analyze.sh) command comes with these command - `--profile Neo4j-latest-continue-on-scan-errors` is based on the default profile (`Neo4j-latest`) but uses the jQAssistant configuration template [template-neo4jv5-jqassistant-continue-on-error.yaml](./scripts/configuration/template-neo4jv5-jqassistant-continue-on-error.yaml) to continue on scan error instead of failing fast. This is temporarily useful when there is a known error that needs to be ignored. It is still recommended to use the default profile and fail fast if there is something wrong. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). -- `--profile Neo4j-latest-low-memory` is based on the default profile (`Neo4j-latest`) but uses only half of the memory (RAM) as configured in [template-neo4j-low-memory.conf](./scripts/configuration/template-neo4j-low-memory.conf). This is useful for the analysis of smaller codebases with less resources. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). +- `--profile Neo4j-latest-low-memory` is based on the default profile (`Neo4j-latest`) but uses only half of the memory (RAM) as configured in [template-neo4j-low-memory.conf](./domains/neo4j-management/configuration/template-neo4j-low-memory.conf). This is useful for the analysis of smaller codebases with less resources. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). -- `--profile Neo4j-latest-low-memory-continue-on-scan-errors` is based on the default profile (`Neo4j-latest`) but uses only half of the memory (RAM) as configured in [template-neo4j-low-memory.conf](./scripts/configuration/template-neo4j-low-memory.conf) and the jQAssistant configuration template [template-neo4jv5-jqassistant-continue-on-error.yaml](./scripts/configuration/template-neo4jv5-jqassistant-continue-on-error.yaml) to continue on scan error instead of failing fast. This is temporarily useful when there is a known error that needs to be ignored. It is still recommended to use the default profile and fail fast if there is something wrong. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). +- `--profile Neo4j-latest-low-memory-continue-on-scan-errors` is based on the default profile (`Neo4j-latest`) but uses only half of the memory (RAM) as configured in [template-neo4j-low-memory.conf](./domains/neo4j-management/configuration/template-neo4j-low-memory.conf) and the jQAssistant configuration template [template-neo4jv5-jqassistant-continue-on-error.yaml](./scripts/configuration/template-neo4jv5-jqassistant-continue-on-error.yaml) to continue on scan error instead of failing fast. This is temporarily useful when there is a known error that needs to be ignored. It is still recommended to use the default profile and fail fast if there is something wrong. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). -- `--profile Neo4j-latest-high-memory` is based on the default profile (`Neo4j-latest`) but uses more memory (RAM) as configured in [template-neo4j-high-memory.conf](./scripts/configuration/template-neo4j-high-memory.conf). This is useful for the analysis of larger codebases with more resources. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). +- `--profile Neo4j-latest-high-memory` is based on the default profile (`Neo4j-latest`) but uses more memory (RAM) as configured in [template-neo4j-high-memory.conf](./domains/neo4j-management/configuration/template-neo4j-high-memory.conf). This is useful for the analysis of larger codebases with more resources. Other profiles can be found in the directory [scripts/profiles](./scripts/profiles/). - `--explore` activates the "explore" mode where no reports are generated. Furthermore, Neo4j won't be stopped at the end of the script and will therefore continue running. This makes it easy to just set everything up but then use the running Neo4j server to explore the data manually. @@ -204,22 +206,22 @@ If any of the script are not allowed to be executed use `chmod +x ./scripts/` fo ### Setup Neo4j Graph Database -Use [setupNeo4j.sh](./scripts/setupNeo4j.sh) to download [Neo4j](https://neo4j.com/download-center) and install the plugins [APOC](https://neo4j.com/labs/apoc/4.4) and [Graph Data Science](https://neo4j.com/product/graph-data-science). +Use [setupNeo4j.sh](./domains/neo4j-management/setupNeo4j.sh) to download [Neo4j](https://neo4j.com/download-center) and install the plugins [APOC](https://neo4j.com/labs/apoc/4.4) and [Graph Data Science](https://neo4j.com/product/graph-data-science). This script requires the environment variable NEO4J_INITIAL_PASSWORD to be set. It sets the initial password with a temporary `NEO4J_HOME` environment variable to not interfere with a possibly globally installed Neo4j installation. ### Change Neo4j configuration template -Use [configureNeo4j.sh](./scripts/configureNeo4j.sh) to apply a different Neo4j configuration template from the [scripts/configuration](./scripts/configuration/) directory. This can be useful to optimize Neo4j for different workloads. Example: +Use [configureNeo4j.sh](./domains/neo4j-management/configureNeo4j.sh) to apply a different Neo4j configuration template from the [domains/neo4j-management/configuration](./domains/neo4j-management/configuration/) directory. This can be useful to optimize Neo4j for different workloads. Example: ```shell -NEO4J_CONFIG_TEMPLATE=template-neo4j-high-memory.conf ./scripts/configureNeo4j.sh +NEO4J_CONFIG_TEMPLATE=template-neo4j-high-memory.conf ./domains/neo4j-management/configureNeo4j.sh ``` **Hint:** In case you want to switch to the high memory profile as in the example, there is a simpler solution. Just run `useNeo4jHighMemoryProfile.sh` from the analysis workspace directory which will set the environment variable `NEO4J_CONFIG_TEMPLATE` and run `configureNeo4j.sh` for you. ### Start Neo4j Graph Database -Use [startNeo4j.sh](./scripts/startNeo4j.sh) to start the locally installed [Neo4j](https://neo4j.com/download-center) Graph database. +Use [startNeo4j.sh](./domains/neo4j-management/startNeo4j.sh) to start the locally installed [Neo4j](https://neo4j.com/download-center) Graph database. It runs the script with a temporary `NEO4J_HOME` environment variable to not interfere with a possibly globally installed Neo4j installation. **Hint:** Within the analysis workspace directory you can simply run `startNeo4j.sh` directly without the `../../` prefix since the script is also available in the analysis workspace. @@ -380,7 +382,7 @@ execute_cypher ./cypher/Get_Graph_Data_Science_Library_Version.cypher a=1 ## Stop Neo4j -Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Graph Database. It does nothing if the database is already stopped. It runs the script with a temporary `NEO4J_HOME` environment variable to not interfere with a possibly globally installed Neo4j installation. +Use [stopNeo4j.sh](./domains/neo4j-management/stopNeo4j.sh) to stop the locally running Neo4j Graph Database. It does nothing if the database is already stopped. It runs the script with a temporary `NEO4J_HOME` environment variable to not interfere with a possibly globally installed Neo4j installation. **Hint:** Within the analysis workspace directory you can run `stopNeo4j.sh` directly without the `../../` prefix since the script is also directly available in the analysis workspace. diff --git a/README.md b/README.md index 949a24987..161ef8471 100644 --- a/README.md +++ b/README.md @@ -304,7 +304,7 @@ The [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-an 👉 Simply run `useNeo4jHighMemoryProfile.sh` in your analysis working directory, or: ```shell - ./../../scripts/useNeo4jHighMemoryProfile.sh + ./../../domains/neo4j-management/useNeo4jHighMemoryProfile.sh ``` ## 🕸 Web References diff --git a/domains/neo4j-management/README.md b/domains/neo4j-management/README.md new file mode 100644 index 000000000..0db492304 --- /dev/null +++ b/domains/neo4j-management/README.md @@ -0,0 +1,86 @@ +# Neo4j Management Domain + +Owns the full lifecycle of the local Neo4j Graph Database: download, install, configure, start, and stop. + +## When to use + +**Normally you don't need this.** [`analyze.sh`](./../../scripts/analysis/analyze.sh) handles setup, start, and stop automatically. Environment variables are set by the profile (`--profile`) — no manual configuration needed. + +Use this domain directly only for on-demand tasks outside a full analysis run: + +- **Start / stop** Neo4j manually (e.g. after a reboot, or to free resources) +- **Reconfigure** without re-running the full analysis (e.g. increase memory) +- **Check** whether and where Neo4j is installed and running + +> ⚠️ **Stop Neo4j before switching projects.** If Neo4j keeps running across projects, data from different projects can end up in the same database instance. + +## Scripts + +### Entry points + +| Script | Purpose | +|--------|---------| +| [startNeo4j.sh](./startNeo4j.sh) | Start Neo4j and wait until it is queryable | +| [stopNeo4j.sh](./stopNeo4j.sh) | Stop Neo4j gracefully | +| [configureNeo4j.sh](./configureNeo4j.sh) | Apply a configuration template from `configuration/` | +| [useNeo4jHighMemoryProfile.sh](./useNeo4jHighMemoryProfile.sh) | Apply the high-memory configuration template | +| [detectNeo4j.sh](./detectNeo4j.sh) | Detect whether Neo4j is installed in the tools directory | +| [detectNeo4jWindows.sh](./detectNeo4jWindows.sh) | Windows-specific detection helper | +| [setupNeo4j.sh](./setupNeo4j.sh) | Install Neo4j with APOC and Graph Data Science — **called by `analyze.sh` automatically** | + +### Internal helpers _(not for direct use)_ + +| Script | Purpose | +|--------|---------| +| [setupNeo4jInitialPassword.sh](./setupNeo4jInitialPassword.sh) | Set the initial Neo4j password (sourced by `setupNeo4j.sh`) | +| [waitForNeo4jHttpFunctions.sh](./waitForNeo4jHttpFunctions.sh) | HTTP polling functions (sourced by `startNeo4j.sh` / `stopNeo4j.sh`) | + +### Tests + +| Script | Purpose | +|--------|---------| +| [testConfigureNeo4j.sh](./testConfigureNeo4j.sh) | Integration tests for `configureNeo4j.sh` | + +## Configuration templates + +Stored under `configuration/`. Select a template via `NEO4J_CONFIG_TEMPLATE` (set automatically by the profile in normal runs). + +| Template | Use case | +|----------|---------| +| [template-neo4j.conf](./configuration/template-neo4j.conf) | Default (Neo4j v5) | +| [template-neo4j-high-memory.conf](./configuration/template-neo4j-high-memory.conf) | Increased heap and page-cache for large graphs | +| [template-neo4j-low-memory.conf](./configuration/template-neo4j-low-memory.conf) | Reduced memory for constrained environments | +| [template-neo4j-v4.conf](./configuration/template-neo4j-v4.conf) | Default (Neo4j v4) | +| [template-neo4j-v4-low-memory.conf](./configuration/template-neo4j-v4-low-memory.conf) | Low-memory (Neo4j v4) | + +## On-demand examples + +Run from an analysis workspace (e.g. `temp/MyProject`) using the workspace forwarding scripts, or from the repo root using the full path. + +```shell +export NEO4J_INITIAL_PASSWORD=my-secret + +./startNeo4j.sh # start (workspace shortcut) +./stopNeo4j.sh # stop (always do this before switching projects) +./useNeo4jHighMemoryProfile.sh # reconfigure with high-memory template + +# From the repo root: +./domains/neo4j-management/startNeo4j.sh +./domains/neo4j-management/stopNeo4j.sh +``` + +## Environment variables + +All variables are set automatically by `analyze.sh` via the selected profile in normal runs. See [`ENVIRONMENT_VARIABLES.md`](../../ENVIRONMENT_VARIABLES.md) for the full generated reference. + +| Variable | Default | Description | +|----------|---------|-------------| +| `NEO4J_INITIAL_PASSWORD` | _(required)_ | Initial password for the local Neo4j instance | +| `NEO4J_VERSION` | _(set in profile)_ | Neo4j version to download/use | +| `NEO4J_EDITION` | `community` | `community` or `enterprise` | +| `NEO4J_HTTP_PORT` | `7474` | HTTP port | +| `NEO4J_BOLT_PORT` | `7687` | Bolt protocol port | +| `NEO4J_CONFIG_TEMPLATE` | `template-neo4j.conf` | Configuration template filename | +| `TOOLS_DIRECTORY` | `tools` | Directory where Neo4j is installed | +| `NEO4J_MANAGEMENT_DIR` | _(auto-resolved)_ | Absolute path to this domain directory | +| `SCRIPTS_DIR` | _(auto-resolved)_ | Absolute path to the shared `scripts/` directory | diff --git a/scripts/configuration/template-neo4j-high-memory.conf b/domains/neo4j-management/configuration/template-neo4j-high-memory.conf similarity index 100% rename from scripts/configuration/template-neo4j-high-memory.conf rename to domains/neo4j-management/configuration/template-neo4j-high-memory.conf diff --git a/scripts/configuration/template-neo4j-low-memory.conf b/domains/neo4j-management/configuration/template-neo4j-low-memory.conf similarity index 100% rename from scripts/configuration/template-neo4j-low-memory.conf rename to domains/neo4j-management/configuration/template-neo4j-low-memory.conf diff --git a/scripts/configuration/template-neo4j-v4-low-memory.conf b/domains/neo4j-management/configuration/template-neo4j-v4-low-memory.conf similarity index 100% rename from scripts/configuration/template-neo4j-v4-low-memory.conf rename to domains/neo4j-management/configuration/template-neo4j-v4-low-memory.conf diff --git a/scripts/configuration/template-neo4j-v4.conf b/domains/neo4j-management/configuration/template-neo4j-v4.conf similarity index 100% rename from scripts/configuration/template-neo4j-v4.conf rename to domains/neo4j-management/configuration/template-neo4j-v4.conf diff --git a/scripts/configuration/template-neo4j.conf b/domains/neo4j-management/configuration/template-neo4j.conf similarity index 100% rename from scripts/configuration/template-neo4j.conf rename to domains/neo4j-management/configuration/template-neo4j.conf diff --git a/scripts/configureNeo4j.sh b/domains/neo4j-management/configureNeo4j.sh similarity index 94% rename from scripts/configureNeo4j.sh rename to domains/neo4j-management/configureNeo4j.sh index 68d7bfdf7..79abb5347 100755 --- a/scripts/configureNeo4j.sh +++ b/domains/neo4j-management/configureNeo4j.sh @@ -3,7 +3,7 @@ # Configures a (local) Neo4j Community Edition Graph Database (https://neo4j.com/download-center/#community). # # Main input is the environment variable NEO4J_CONFIG_TEMPLATE: -# - The name of the template file ("scripts/configuration" folder) for the Neo4j configuration. +# - The name of the template file ("domains/neo4j-management/configuration" folder) for the Neo4j configuration. # - Defaults to "template-neo4j.conf". # - The template configuration will be appended to the end of the Neo4j configuration file. # @@ -13,7 +13,7 @@ # - The tools directory has been created # # Example Usage: -# - NEO4J_CONFIG_TEMPLATE=template-neo4j-high-memory.conf ./../../scripts/configureNeo4j.sh +# - NEO4J_CONFIG_TEMPLATE=template-neo4j-high-memory.conf ./../../domains/neo4j-management/configureNeo4j.sh # # When run for the first time, the original configuration will be backed up and all configuration entries will be set. # When run again (re-configuration), the template configuration at the end if the script is executed again. @@ -48,11 +48,12 @@ NEO4J_BOLT_PORT=${NEO4J_BOLT_PORT:-"7687"} # Neo4j's own "Bolt Protocol" port NEO4J_CONFIG_TEMPLATE=${NEO4J_CONFIG_TEMPLATE:-"template-neo4j.conf"} # Name of the template file ("configuration" folder) for the Neo4j configuration. Defaults to "template-neo4j.conf". -## Get this "scripts" directory if not already set +## Get this domain directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts SCRIPT_NAME="configureNeo4j" #echo "${SCRIPT_NAME}: SCRIPTS_DIR=${SCRIPTS_DIR}" @@ -61,7 +62,7 @@ NEO4J_INSTALLATION_NAME="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" NEO4J_INSTALLATION_DIRECTORY="${TOOLS_DIRECTORY}/${NEO4J_INSTALLATION_NAME}" NEO4J_CONFIG="${NEO4J_INSTALLATION_DIRECTORY}/conf/neo4j.conf" NEO4J_MAJOR_VERSION_NUMBER=$(echo "${NEO4J_VERSION}" | cut -d'.' -f1) # First part of the version number (=major version number) -NEO4J_CONFIG_TEMPLATE_PATH="${SCRIPTS_DIR}/configuration/${NEO4J_CONFIG_TEMPLATE}" +NEO4J_CONFIG_TEMPLATE_PATH="${NEO4J_MANAGEMENT_DIR}/configuration/${NEO4J_CONFIG_TEMPLATE}" # Include operation system functions like "convertPosixToWindowsPathIfNecessary". source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" @@ -151,7 +152,7 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then fi if [ ! -f "${NEO4J_CONFIG_TEMPLATE_PATH}" ]; then - fail "Configuration template file ${NEO4J_CONFIG_TEMPLATE} does not exist in the scripts/configuration folder. Please make sure it exists and is correctly named:\n${NEO4J_CONFIG_TEMPLATE_PATH}" + fail "Configuration template file ${NEO4J_CONFIG_TEMPLATE} does not exist in the domains/neo4j-management/configuration folder. Please make sure it exists and is correctly named:\n${NEO4J_CONFIG_TEMPLATE_PATH}" fi # Create a backup of the original configuration file before any modification in case there is none yet. diff --git a/domains/neo4j-management/detectNeo4j.sh b/domains/neo4j-management/detectNeo4j.sh new file mode 100755 index 000000000..ca5a81350 --- /dev/null +++ b/domains/neo4j-management/detectNeo4j.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Detects if Neo4j is running and outputs its installation directory. +# Outputs "Neo4j not running" or "Neo4j running in ". +# Adds the analysis workspace name in parentheses if it can be determined from the path. +# Compatible with Linux and macOS. Requires only standard POSIX commands. +# Can be run from any directory – it inspects the process table, not the file system. + +# Fail on any error +set -o errexit + +# Overrideable Defaults +TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Tools directory name used to detect the analysis workspace + +# Find any process that contains "neo4j" in its command arguments. +# The bracket pattern '[n]eo4j' prevents grep from matching its own process entry, +# removing the need for a separate 'grep -v grep' step. +_neo4j_cmd=$(ps -eo command 2>/dev/null | grep -i '[n]eo4j' | head -1) + +if [ -z "${_neo4j_cmd}" ]; then + echo "Neo4j not running" + exit 0 +fi + +# Extract home from '--home-dir=' command-line argument (Neo4j 5+ / 2025+). +_neo4j_home=$(printf '%s' "${_neo4j_cmd}" \ + | grep -oE '\-\-home-dir=[^[:space:]]+' \ + | head -1 \ + | cut -d= -f2-) + +# Fallback: extract home from '-Dneo4j.home=' JVM system property (Neo4j 4 and older). +if [ -z "${_neo4j_home}" ]; then + _neo4j_home=$(printf '%s' "${_neo4j_cmd}" \ + | grep -oE '\-Dneo4j\.home=[^[:space:]]+' \ + | head -1 \ + | cut -d= -f2-) +fi + +# Fallback: derive path from the lib directory in the Java classpath (-cp / -classpath). +# The classpath typically contains an entry like '/lib/*'. +if [ -z "${_neo4j_home}" ]; then + _neo4j_home=$(printf '%s' "${_neo4j_cmd}" \ + | grep -oE '[^[:space:]]+/lib/\*' \ + | head -1 \ + | sed 's|/lib/\*||') +fi + +if [ -z "${_neo4j_home}" ]; then + echo "Neo4j running in (path undetermined)" + exit 0 +fi + +# Try to extract the analysis workspace name from the path. +# Pattern: .../temp///... +_workspace=$(printf '%s' "${_neo4j_home}" \ + | sed -n "s|.*/temp/\([^/]*\)/${TOOLS_DIRECTORY}/.*|\1|p") + +if [ -n "${_workspace}" ]; then + echo "Neo4j running in ${_neo4j_home} (workspace: ${_workspace})" +else + echo "Neo4j running in ${_neo4j_home}" +fi diff --git a/domains/neo4j-management/detectNeo4jWindows.sh b/domains/neo4j-management/detectNeo4jWindows.sh new file mode 100755 index 000000000..475e9e413 --- /dev/null +++ b/domains/neo4j-management/detectNeo4jWindows.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +# Detects if Neo4j is running on Windows from WSL or Git Bash. +# Outputs "Neo4j not running" or "Neo4j running in ". +# Adds the analysis workspace name in parentheses if it can be determined from the path. +# Compatible with WSL (Windows Subsystem for Linux) and Git Bash (MSYS2/MINGW). +# Requires Windows PowerShell (powershell.exe) to query Windows processes. +# For Linux or macOS use detectNeo4j.sh instead. + +# Fail on any error +set -o errexit + +# Overrideable Defaults +TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Tools directory name used to detect the analysis workspace + +# Detect if running in WSL (Windows Subsystem for Linux) +_is_wsl=false +if grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null; then + _is_wsl=true +fi + +# Detect if running in Git Bash (MSYS2/MINGW) or Cygwin +_is_git_bash=false +if [[ "${OSTYPE}" == "msys" ]] || [[ "${OSTYPE}" == "cygwin" ]]; then + _is_git_bash=true +fi + +if [ "${_is_wsl}" = "false" ] && [ "${_is_git_bash}" = "false" ]; then + echo "detectNeo4j: Error: This script is intended for WSL or Git Bash on Windows." + echo "detectNeo4j: For Linux or macOS, use detectNeo4j.sh instead." + exit 1 +fi + +# Find Windows PowerShell (powershell.exe). +# In WSL it is accessible via Windows interop; in Git Bash via the Windows PATH. +_powershell="" +for _candidate in \ + "powershell.exe" \ + "powershell" \ + "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe" \ + "/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"; do + if command -v "${_candidate}" >/dev/null 2>&1; then + _powershell="${_candidate}" + break + fi +done + +if [ -z "${_powershell}" ]; then + echo "detectNeo4j: Error: Windows PowerShell (powershell.exe) not found." + if [ "${_is_wsl}" = "true" ]; then + echo "detectNeo4j: Ensure Windows interop is enabled in WSL (/proc/sys/fs/binfmt_misc/WSLInterop)." + fi + exit 1 +fi + +# Write a temporary PowerShell script to query the Neo4j Windows process. +# Using a heredoc and a temp file avoids the complex inline escaping required by .bat. +_ps_script=$(mktemp /tmp/detectNeo4j_XXXXXX.ps1) + +# The first heredoc block uses single quotes ('PWSH') so that the shell does not expand +# anything inside it. TOOLS_DIRECTORY is injected separately via printf afterwards. +cat > "${_ps_script}" << 'PWSH' +$p = (try { + Get-CimInstance Win32_Process -Filter "Name='java.exe'" -ErrorAction Stop +} catch { + Get-WmiObject Win32_Process -Filter "Name='java.exe'" -ErrorAction SilentlyContinue +}) | Where-Object { $_.CommandLine -like '*neo4j*' } | Select-Object -First 1 + +if (-not $p) { exit } + +$cmd = $p.CommandLine +PWSH + +# Inject shell variable value as a PowerShell string literal. +# Use a PowerShell single-quoted string and escape embedded single quotes by doubling them. +_tools_directory_ps=${TOOLS_DIRECTORY//\'/\'\'} +printf "\$toolsDir = '%s'\n" "${_tools_directory_ps}" >> "${_ps_script}" + +cat >> "${_ps_script}" << 'PWSH' +# Extract the Neo4j home path: try three strategies in priority order +$neo4jHome = '' +if ($cmd -match '--home-dir=(\S+)') { $neo4jHome = $Matches[1] } +if (-not $neo4jHome -and $cmd -match '-Dneo4j\.home=(\S+)') { $neo4jHome = $Matches[1] } +if (-not $neo4jHome -and $cmd -match '([^;]+)\\lib\\\*') { $neo4jHome = $Matches[1] } +if (-not $neo4jHome) { Write-Output '__UNKNOWN__|'; exit } + +# Try to extract the analysis workspace name from the path. +# Pattern (backslashes): ...\temp\\\... +# Pattern (forward slashes, edge cases): .../temp///... +$workspace = '' +if ($neo4jHome -match '\\temp\\([^\\]+)\\' + $toolsDir + '\\') { $workspace = $Matches[1] } +if (-not $workspace -and $neo4jHome -match '/temp/([^/]+)/' + $toolsDir + '/') { $workspace = $Matches[1] } + +Write-Output "$neo4jHome|$workspace" +PWSH + +# Execute the PowerShell script and capture output. +# "|| true" prevents set -e from aborting when PowerShell exits with a non-zero code. +_result=$(${_powershell} -NoProfile -ExecutionPolicy Bypass -File "${_ps_script}" 2>/dev/null || true) + +# Remove the temporary PowerShell script +rm -f "${_ps_script}" + +# Strip Windows carriage returns (\r) that powershell.exe may add in WSL +_result=$(printf '%s' "${_result}" | tr -d '\r') + +# Split the pipe-separated result into home path and workspace name. +# IFS='|' read assigns everything before the first '|' to _neo4j_home, +# and the remainder to _workspace (empty string when not found). +IFS='|' read -r _neo4j_home _workspace <<< "${_result}" + +if [ -z "${_neo4j_home}" ]; then + echo "Neo4j not running" + exit 0 +fi + +if [ "${_neo4j_home}" = "__UNKNOWN__" ]; then + echo "Neo4j running in (path undetermined)" + exit 0 +fi + +# Convert Windows backslashes to forward slashes for readability in a Unix shell context +_neo4j_home_display=$(printf '%s' "${_neo4j_home}" | tr '\\' '/') + +if [ -n "${_workspace}" ]; then + echo "Neo4j running in ${_neo4j_home_display} (workspace: ${_workspace})" +else + echo "Neo4j running in ${_neo4j_home_display}" +fi diff --git a/scripts/setupNeo4j.sh b/domains/neo4j-management/setupNeo4j.sh similarity index 94% rename from scripts/setupNeo4j.sh rename to domains/neo4j-management/setupNeo4j.sh index 7795cf369..f4119f4b1 100755 --- a/scripts/setupNeo4j.sh +++ b/domains/neo4j-management/setupNeo4j.sh @@ -31,11 +31,12 @@ NEO4J_APOC_CONFIG="${NEO4J_INSTALLATION_DIRECTORY}/conf/apoc.conf" NEO4J_APOC_PLUGIN_ARTIFACT="apoc-${NEO4J_APOC_PLUGIN_VERSION}-${NEO4J_APOC_PLUGIN_EDITION}.jar" NEO4J_MAJOR_VERSION_NUMBER=$(echo "$NEO4J_VERSION" | cut -d'.' -f1) # First part of the version number (=major version number) -## Get this "scripts" directory if not already set +## Get this domain directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts echo "setupNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" # Check if TOOLS_DIRECTORY variable is set @@ -90,11 +91,11 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then exit 1 fi - source "${SCRIPTS_DIR}/configureNeo4j.sh" + source "${NEO4J_MANAGEMENT_DIR}/configureNeo4j.sh" # Set initial password for user "neo4j" otherwise the default password "neo4j" would need to be changed immediately (prompt). # This needs to be done after the configuration changes. - source "${SCRIPTS_DIR}/setupNeo4jInitialPassword.sh" + source "${NEO4J_MANAGEMENT_DIR}/setupNeo4jInitialPassword.sh" echo "setupNeo4j: Installed successfully" else diff --git a/scripts/setupNeo4jInitialPassword.sh b/domains/neo4j-management/setupNeo4jInitialPassword.sh similarity index 87% rename from scripts/setupNeo4jInitialPassword.sh rename to domains/neo4j-management/setupNeo4jInitialPassword.sh index 0ebd4e8ce..c24489c71 100755 --- a/scripts/setupNeo4jInitialPassword.sh +++ b/domains/neo4j-management/setupNeo4jInitialPassword.sh @@ -15,12 +15,13 @@ TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Get the tools directory (defaults NEO4J_INSTALLATION_NAME="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" NEO4J_INSTALLATION_DIRECTORY="${TOOLS_DIRECTORY}/${NEO4J_INSTALLATION_NAME}" -## Get this "scripts" directory if not already set +## Get this domain directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts -echo "startNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts +echo "setupNeo4jInitialPassword: SCRIPTS_DIR=$SCRIPTS_DIR" # Check if environment variable is set if [ -z "${NEO4J_INITIAL_PASSWORD}" ]; then diff --git a/domains/neo4j-management/startNeo4j.sh b/domains/neo4j-management/startNeo4j.sh new file mode 100755 index 000000000..fe4032436 --- /dev/null +++ b/domains/neo4j-management/startNeo4j.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +# Starts the local Neo4j Graph Database. + +# Note: Does nothing if the database is already running. +# Note: It requires Neo4j to be installed in the TOOLS_DIRECTORY. + +# Requires waitForNeo4jHttp.sh,operatingSystemFunctions.sh + +# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) +set -o errexit -o pipefail + +# Overrideable Defaults +NEO4J_EDITION=${NEO4J_EDITION:-"community"} # Choose "community" or "enterprise" +NEO4J_VERSION=${NEO4J_VERSION:-"2026.01.4"} +TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Get the tools directory (defaults to "tools") +NEO4J_HTTP_PORT=${NEO4J_HTTP_PORT:-"7474"} + +## Get this domain directory if not already set +# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. +# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. +# This way non-standard tools like readlink aren't needed. +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts +echo "startNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" + +# Check if environment variable NEO4J_INITIAL_PASSWORD is set +if [ -z "${NEO4J_INITIAL_PASSWORD}" ]; then + echo "startNeo4j: Error: Requires environment variable NEO4J_INITIAL_PASSWORD to be set first. Use 'export NEO4J_INITIAL_PASSWORD='." + exit 1 +fi + +# Check if TOOLS_DIRECTORY variable is set +if [ -z "${TOOLS_DIRECTORY}" ]; then + echo "startNeo4j: Requires variable TOOLS_DIRECTORY to be set. If it is the current directory, then use a dot to reflect that." + exit 1 +fi + +# Detect Neo4j directory within the "tools" directory +neo4j_directory="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" # Default directory using environment variables +if [ ! -d "${TOOLS_DIRECTORY}/${neo4j_directory}" ] ; then + # Default directory doesn't exist. Try to find one with another version. + # This usually happens when Neo4j had been updated while a local project is still using an older version. + neo4j_directories=$(find "./${TOOLS_DIRECTORY}" -type d -name "neo4j-${NEO4J_EDITION}-*" | sort -r | head -n 1) + neo4j_directory=$(basename -- "$neo4j_directories") + echo "startNeo4j: Auto detected Neo4j directory within the tools directory: ${neo4j_directory}" +fi + +# Internal Constants +NEO4J_DIR="${TOOLS_DIRECTORY}/${neo4j_directory}" +NEO4J_DIR_WINDOWS="${TOOLS_DIRECTORY}\\${neo4j_directory}" +NEO4J_BIN="${NEO4J_DIR}/bin" +NEO4J_BIN_WINDOWS="${NEO4J_DIR_WINDOWS}\bin" + +# Check if Neo4j is installed +if [ -d "${NEO4J_BIN}" ] ; then + echo "startNeo4j: Using Neo4j binary directory ${NEO4J_BIN}" +else + echo "startNeo4j: Directory ${NEO4J_BIN} doesn't exist. Please run setupNeo4j.sh first." + exit 1 +fi + +# Include operation system function to for example detect Windows. +source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" + +# Include functions to check or wait for the database to be ready +source "${NEO4J_MANAGEMENT_DIR}/waitForNeo4jHttpFunctions.sh" + +# Check if Neo4j is stopped (not running) using a temporary NEO4J_HOME environment variable that points to the current installation +isDatabaseReady=$(isDatabaseQueryable) +if [[ ${isDatabaseReady} == "false" ]]; then + echo "startNeo4j: Starting ${neo4j_directory} in ${NEO4J_DIR}" + + # Check if there is already a process that listens to the Neo4j HTTP port + if isWindows; then + echo "startNeo4j: Skipping detection of processes listening to port ${NEO4J_HTTP_PORT} on Windows" + else + port_listener_process_id=$( lsof -t -i:"${NEO4J_HTTP_PORT}" -sTCP:LISTEN || true ) + if [ -n "${port_listener_process_id}" ]; then + echo "startNeo4j: There is already a process that listens to port ${NEO4J_HTTP_PORT}" + ps -p "${port_listener_process_id}" + echo "startNeo4j: Use this command to stop it: kill -9 \$( lsof -t -i:${NEO4J_HTTP_PORT} -sTCP:LISTEN )" + exit 1 + fi + fi + + # Start Neo4j using a temporary NEO4J_HOME environment variable that points to the current installation + if isWindows; then + neo4jStartCommand="${NEO4J_BIN_WINDOWS}\neo4j.bat console --verbose" + # On Windows it is necessary to take the absolute full qualified path to Neo4j for the environment variable NEO4J_HOME. + # It also works without any environment variable but this would likely lead to ambiguity problems when there are multiple Neo4j instances installed. + # If the path is wrong content-wise this leads to a ClassNotFoundException. + # If the path is wrong syntactically there is an error while reading the plugins directory. + windowsCommandEnvironment="set NEO4J_HOME=%cd%\\${NEO4J_DIR_WINDOWS}&& echo NEO4J_HOME=!NEO4J_HOME!" + windowsCommand="${windowsCommandEnvironment}&&${neo4jStartCommand}" + + echo "startNeo4j: Starting Neo4j on Windows in a separate console window..." + echo "startNeo4j: The following Windows command is used: ${windowsCommand}" + echo "startNeo4j: IMPORTANT: Only close the console window when the scripts and your work is finished !" + + cmd //c start cmd //v //k "${windowsCommand}" + else + NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j start --verbose + fi + + waitUntilDatabaseIsQueryable + +else + echo "startNeo4j: ${neo4j_directory} already started" +fi \ No newline at end of file diff --git a/domains/neo4j-management/stopNeo4j.sh b/domains/neo4j-management/stopNeo4j.sh new file mode 100755 index 000000000..587b92bad --- /dev/null +++ b/domains/neo4j-management/stopNeo4j.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +# Stops the local Neo4j Graph Database. + +# Note: Does nothing if the database is already stopped. + +# Requires waitForNeo4jHttp.sh,operatingSystemFunctions.sh + +# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) +set -o errexit -o pipefail + +# Overrideable Defaults +NEO4J_EDITION=${NEO4J_EDITION:-"community"} # Choose "community" or "enterprise" +NEO4J_VERSION=${NEO4J_VERSION:-"2026.01.4"} +TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Get the tools directory (defaults to "tools") +NEO4J_HTTP_PORT=${NEO4J_HTTP_PORT:-"7474"} + +## Get this domain directory if not already set +# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. +# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. +# This way non-standard tools like readlink aren't needed. +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts +echo "stopNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" + +# Check if TOOLS_DIRECTORY variable is set +if [ -z "${TOOLS_DIRECTORY}" ]; then + echo "stopNeo4j: Requires variable TOOLS_DIRECTORY to be set. If it is the current directory, then use a dot to reflect that." + exit 1 +fi + +# Detect Neo4j directory within the "tools" directory +# If the version had been updated and a local project still uses the +neo4j_directory="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" # Default directory using environment variables +if [ ! -d "${TOOLS_DIRECTORY}/${neo4j_directory}" ] ; then + # Default directory doesn't exist. Try to find one with another version. + # This usually happens when Neo4j had been updated while a local project is still using an older version. + neo4j_directories=$(find "./${TOOLS_DIRECTORY}" -type d -name "neo4j-${NEO4J_EDITION}-*" | sort -r | head -n 1) + neo4j_directory=$(basename -- "$neo4j_directories") + echo "stopNeo4j: Auto detected Neo4j directory within the tools directory: ${neo4j_directory}" +fi + +# Internal Constants +NEO4J_DIR="${TOOLS_DIRECTORY}/${neo4j_directory}" +NEO4J_BIN="${NEO4J_DIR}/bin" + +# Check if Neo4j is installed +if [ -d "${NEO4J_BIN}" ] ; then + echo "stopNeo4j: Using Neo4j binary directory ${NEO4J_BIN}" +else + echo "stopNeo4j: Directory ${NEO4J_BIN} doesn't exist. Please run setupNeo4j.sh first." + exit 1 +fi + +# Include operation system function to for example detect Windows like isWindows. +source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" + +# Include functions to check or wait for the database to be ready like isDatabaseQueryable. +source "${NEO4J_MANAGEMENT_DIR}/waitForNeo4jHttpFunctions.sh" + +# Check if Neo4j is stopped (not running) using a temporary NEO4J_HOME environment variable that points to the current installation +isDatabaseReady=$(isDatabaseQueryable) +if [ "${isDatabaseReady}" = "false" ]; then + echo "stopNeo4j: ${neo4j_directory} already stopped" + exit 0 +else + if isWindows; then + echo "stopNeo4j: IMPORTANT on Windows: Please close the console window or stop the service manually where ${neo4j_directory} is running." + else + # Stop Neo4j using a temporary NEO4J_HOME environment variable that points to the current installation + NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j stop + fi +fi + +#Check if Neo4j is still not running using a temporary NEO4J_HOME environment variable that points to the current installation +isDatabaseReady=$(isDatabaseQueryable) +if [ "${isDatabaseReady}" = "false" ]; then + echo "stopNeo4j: Successfully stopped ${neo4j_directory}" +else + if ! isWindows; then + echo "stopNeo4j: ${neo4j_directory} still running. Something went wrong. Details see 'NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j status'." + exit 1 + fi +fi + +# Check if there are still processes running that listen to the Neo4j HTTP port +if isWindows; then + echo "stopNeo4j: Skipping detection of processes listening to port ${NEO4J_HTTP_PORT} on Windows" +else + port_listener_process_ids=$( lsof -t -i:"${NEO4J_HTTP_PORT}" -sTCP:LISTEN 2>/dev/null || true ) + if [ -n "${port_listener_process_ids}" ]; then + echo "stopNeo4j: Gracefully terminating process(es) listening to port ${NEO4J_HTTP_PORT}" + # Display process info + echo "${port_listener_process_ids}" | tr '\n' ',' | sed 's/,$//' | xargs -I {} ps -p {} || true + # Try graceful shutdown first with SIGTERM on each PID + echo "${port_listener_process_ids}" | while read -r pid; do + [ -n "${pid}" ] && kill -TERM "${pid}" 2>/dev/null || true + done + sleep 20 + # Check if process(es) are still alive and force kill if necessary + echo "${port_listener_process_ids}" | while read -r pid; do + [ -n "${pid}" ] && kill -0 "${pid}" 2>/dev/null && { + echo "stopNeo4j: Process ${pid} still alive after SIGTERM — sending SIGKILL" + kill -KILL "${pid}" 2>/dev/null || true + } || true + done + else + echo "stopNeo4j: No processes listening to port ${NEO4J_HTTP_PORT} detected. Assuming Neo4j is stopped." + fi +fi \ No newline at end of file diff --git a/scripts/testConfigureNeo4j.sh b/domains/neo4j-management/testConfigureNeo4j.sh similarity index 86% rename from scripts/testConfigureNeo4j.sh rename to domains/neo4j-management/testConfigureNeo4j.sh index 7d0c0c11e..a4d7b4590 100755 --- a/scripts/testConfigureNeo4j.sh +++ b/domains/neo4j-management/testConfigureNeo4j.sh @@ -4,16 +4,16 @@ # # Usage # # Run full test suite using a deterministic temporary directory: -# TEST_TMPDIR=./tmp/tmpdir bash scripts/testConfigureNeo4j.sh +# TEST_TMPDIR=./tmp/tmpdir bash domains/neo4j-management/testConfigureNeo4j.sh # # # Capture console output to a log file (recommended for CI or debugging): -# TEST_TMPDIR=./tmp/tmpdir bash scripts/testConfigureNeo4j.sh &> test_run.log || true +# TEST_TMPDIR=./tmp/tmpdir bash domains/neo4j-management/testConfigureNeo4j.sh &> test_run.log || true # # Troubleshooting # - To enable a shell trace: run with `bash -x`: -# TEST_TMPDIR=./tmp/tmpdir bash -x scripts/testConfigureNeo4j.sh &> trace.log || true +# TEST_TMPDIR=./tmp/tmpdir bash -x domains/neo4j-management/testConfigureNeo4j.sh &> trace.log || true # - The harness writes per-test logs into the test tempdir as: -# $TEST_TMPDIR/$(basename scripts/testConfigureNeo4j.sh)-.log +# $TEST_TMPDIR/$(basename domains/neo4j-management/testConfigureNeo4j.sh)-.log # (If you redirect console output to a file, those per-test logs are preserved # inside the test_run.log capture and can also be inspected directly while the # test is running.) @@ -42,8 +42,8 @@ COLOR_DE_EMPHASIZED='\033[0;90m' # dark gray COLOR_SUCCESSFUL="\033[0;32m" # green COLOR_DEFAULT='\033[0m' -## Get this "scripts" directory if not already set -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} +## Get this domain directory if not already set +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} tearDown() { rm -rf "${temporaryTestDirectory}" @@ -103,7 +103,8 @@ configureNeo4jExpectingSuccessUnderTest() { logFile="${temporaryTestDirectory}/${SCRIPT_NAME}-${test_case_number}.log" : >"${logFile}" # Run configure in a clean bash with controlled env; redirect all output to the log file. - env SCRIPTS_DIR="${temporaryTestDirectory}/scripts" \ + env NEO4J_MANAGEMENT_DIR="${temporaryTestDirectory}/neo4j-management" \ + SCRIPTS_DIR="${temporaryTestDirectory}/scripts" \ TOOLS_DIRECTORY="${TOOLS_DIRECTORY}" \ SHARED_DOWNLOADS_DIRECTORY="${SHARED_DOWNLOADS_DIRECTORY}" \ DATA_DIRECTORY="${DATA_DIRECTORY}" \ @@ -127,7 +128,8 @@ configureNeo4jExpectingFailureUnderTest() { # Ensure log file exists logFile="${temporaryTestDirectory}/${SCRIPT_NAME}-${test_case_number}.log" : >"${logFile}" - env SCRIPTS_DIR="${temporaryTestDirectory}/scripts" \ + env NEO4J_MANAGEMENT_DIR="${temporaryTestDirectory}/neo4j-management" \ + SCRIPTS_DIR="${temporaryTestDirectory}/scripts" \ TOOLS_DIRECTORY="${TOOLS_DIRECTORY}" \ SHARED_DOWNLOADS_DIRECTORY="${SHARED_DOWNLOADS_DIRECTORY}" \ DATA_DIRECTORY="${DATA_DIRECTORY}" \ @@ -153,23 +155,24 @@ fi # Normalize to absolute path to avoid relative-path duplication when cd'ing into it temporaryTestDirectory=$(cd "${temporaryTestDirectory}" && pwd -P) -# The test will source the repository's configureNeo4j.sh but override SCRIPTS_DIR so that the script +# The test will source the repository's configureNeo4j.sh but override SCRIPTS_DIR and NEO4J_MANAGEMENT_DIR so that the script # picks up test-provided helper files (operatingSystemFunctions.sh) and template files from the temp dir. # Compute repository scripts dir explicitly and path to the configure script. -REPO_SCRIPTS_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P) -REPO_CONFIGURE_SCRIPT="${REPO_SCRIPTS_DIR}/configureNeo4j.sh" +REPO_NEO4J_MANAGEMENT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P) +REPO_CONFIGURE_SCRIPT="${REPO_NEO4J_MANAGEMENT_DIR}/configureNeo4j.sh" -mkdir -p "${temporaryTestDirectory}/scripts/configuration" +mkdir -p "${temporaryTestDirectory}/scripts" +mkdir -p "${temporaryTestDirectory}/neo4j-management/configuration" # Use the real operatingSystemFunctions.sh from the repo but disable its # interactive/stderr print (printWindows) to avoid noisy output during tests. -if [ -r "${REPO_SCRIPTS_DIR}/operatingSystemFunctions.sh" ]; then +if [ -r "${REPO_NEO4J_MANAGEMENT_DIR}/../../scripts/operatingSystemFunctions.sh" ]; then mkdir -p "${temporaryTestDirectory}/scripts" - if sed -e 's/^printWindows\s*$/#printWindows/' "${REPO_SCRIPTS_DIR}/operatingSystemFunctions.sh" > "${temporaryTestDirectory}/scripts/operatingSystemFunctions.sh" 2>/dev/null; then + if sed -e 's/^printWindows\s*$/#printWindows/' "${REPO_NEO4J_MANAGEMENT_DIR}/../../scripts/operatingSystemFunctions.sh" > "${temporaryTestDirectory}/scripts/operatingSystemFunctions.sh" 2>/dev/null; then : else # fallback to a minimal copy if sed failed for some reason - cp "${REPO_SCRIPTS_DIR}/operatingSystemFunctions.sh" "${temporaryTestDirectory}/scripts/operatingSystemFunctions.sh" 2>/dev/null || true + cp "${REPO_NEO4J_MANAGEMENT_DIR}/../../scripts/operatingSystemFunctions.sh" "${temporaryTestDirectory}/scripts/operatingSystemFunctions.sh" 2>/dev/null || true fi else # Fallback: minimal implementation if the repo file is missing @@ -208,7 +211,7 @@ NEO4J_INSTALLATION_NAME="neo4j-community-2026.01.4" create_base_neo4j_configuration "${temporaryTestDirectory}/tools/${NEO4J_INSTALLATION_NAME}/conf/neo4j.conf" # Create template with minimal entries expected by tests (v5 entries) -cat > "${temporaryTestDirectory}/scripts/configuration/template-neo4j.conf" <<'EOF' +cat > "${temporaryTestDirectory}/neo4j-management/configuration/template-neo4j.conf" <<'EOF' # Template for tests server.directories.import=/some/import/path db.tx_log.rotation.retention_policy=7 days @@ -287,7 +290,7 @@ info "${test_case_number}.) it should fail when the configuration template file # Recreate the installation and conf mkdir -p "${temporaryTestDirectory}/tools/${NEO4J_INSTALLATION_NAME}/conf" create_base_neo4j_configuration "${temporaryTestDirectory}/tools/${NEO4J_INSTALLATION_NAME}/conf/neo4j.conf" -rm -f "${temporaryTestDirectory}/scripts/configuration/${NEO4J_CONFIG_TEMPLATE:-template-neo4j.conf}" +rm -f "${temporaryTestDirectory}/neo4j-management/configuration/${NEO4J_CONFIG_TEMPLATE:-template-neo4j.conf}" configureNeo4jExpectingFailureUnderTest # ------- Integration Test Case: re-configuration path (backup exists) @@ -296,7 +299,7 @@ echo "" info "${test_case_number}.) it should re-configure (append/replace template) when original backup exists." # Create template again -cat > "${temporaryTestDirectory}/scripts/configuration/template-neo4j.conf" <<'EOF' +cat > "${temporaryTestDirectory}/neo4j-management/configuration/template-neo4j.conf" <<'EOF' # Template for re-configuration test server.directories.import=/another/import db.tx_log.rotation.retention_policy=14 days @@ -331,7 +334,7 @@ mkdir -p "${temporaryTestDirectory}/tools/neo4j-community-4.4.0/conf" touch "${temporaryTestDirectory}/tools/neo4j-community-4.4.0/conf/neo4j.conf.original.backup" # Use a template that contains dbms.* keys -cat > "${temporaryTestDirectory}/scripts/configuration/template-neo4j.conf" <<'EOF' +cat > "${temporaryTestDirectory}/neo4j-management/configuration/template-neo4j.conf" <<'EOF' # v4 template dbms.directories.import=/v4/import dbms.tx_log.rotation.retention_policy=10 days diff --git a/scripts/useNeo4jHighMemoryProfile.sh b/domains/neo4j-management/useNeo4jHighMemoryProfile.sh similarity index 64% rename from scripts/useNeo4jHighMemoryProfile.sh rename to domains/neo4j-management/useNeo4jHighMemoryProfile.sh index f7e5f5e9c..1160357b6 100755 --- a/scripts/useNeo4jHighMemoryProfile.sh +++ b/domains/neo4j-management/useNeo4jHighMemoryProfile.sh @@ -8,19 +8,20 @@ # - Neo4j needs to be installed # # Example Usage: -# - ./../../scripts/useNeo4jHighMemoryProfile.sh +# - ./../../domains/neo4j-management/useNeo4jHighMemoryProfile.sh # # Requires configureNeo4j.sh # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail -## Get this "scripts" directory if not already set +## Get this domain directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts # shellcheck disable=SC2034 NEO4J_CONFIG_TEMPLATE=template-neo4j-high-memory.conf -. "${SCRIPTS_DIR}/configureNeo4j.sh" \ No newline at end of file +. "${NEO4J_MANAGEMENT_DIR}/configureNeo4j.sh" \ No newline at end of file diff --git a/scripts/waitForNeo4jHttpFunctions.sh b/domains/neo4j-management/waitForNeo4jHttpFunctions.sh similarity index 88% rename from scripts/waitForNeo4jHttpFunctions.sh rename to domains/neo4j-management/waitForNeo4jHttpFunctions.sh index 240971f7b..3853ea528 100644 --- a/scripts/waitForNeo4jHttpFunctions.sh +++ b/domains/neo4j-management/waitForNeo4jHttpFunctions.sh @@ -10,11 +10,12 @@ set -o errexit -o pipefail NEO4J_HTTP_PORT=${NEO4J_HTTP_PORT:-"7474"} -## Get this "scripts" directory if not already set +## Get this domain directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts +NEO4J_MANAGEMENT_DIR=${NEO4J_MANAGEMENT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Domain directory containing the neo4j management scripts +SCRIPTS_DIR=${SCRIPTS_DIR:-"${NEO4J_MANAGEMENT_DIR}/../../scripts"} # Repository directory containing the shared shell scripts echo "waitForNeo4jHttp: SCRIPTS_DIR=$SCRIPTS_DIR" # Get the "cypher" directory by taking the path of this script and going one directory up and then to "cypher". diff --git a/init.sh b/init.sh index 280e2373a..91f433438 100755 --- a/init.sh +++ b/init.sh @@ -4,7 +4,7 @@ # Note: This script needs to be executed in the root of this directory (= same directory as this file) -# Requires analyze.sh, startNeo4j.sh, stopNeo4j.sh, checkCompatibility.sh +# Requires analyze.sh, domains/neo4j-management/startNeo4j.sh, domains/neo4j-management/stopNeo4j.sh, checkCompatibility.sh # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail @@ -77,9 +77,9 @@ mkdir -p "./${SOURCE_DIRECTORY}" # Create forwarding scripts for the most important commands createForwardingScript "./../../scripts/analysis/analyze.sh" -createForwardingScript "./../../scripts/startNeo4j.sh" -createForwardingScript "./../../scripts/stopNeo4j.sh" -createForwardingScript "./../../scripts/useNeo4jHighMemoryProfile.sh" +createForwardingScript "./../../domains/neo4j-management/startNeo4j.sh" +createForwardingScript "./../../domains/neo4j-management/stopNeo4j.sh" +createForwardingScript "./../../domains/neo4j-management/useNeo4jHighMemoryProfile.sh" source "${SCRIPTS_DIR}/scripts/checkCompatibility.sh" diff --git a/scripts/analysis/analyze.sh b/scripts/analysis/analyze.sh index 2e505e39f..ec264edf3 100755 --- a/scripts/analysis/analyze.sh +++ b/scripts/analysis/analyze.sh @@ -34,7 +34,7 @@ # when it comes to subsequent executions. # Existing downloads, installations, scans and processes will be detected. -# Requires setupNeo4j.sh,setupJQAssistant.sh,startNeo4j.sh,resetAndScanChanged.sh,prepareAnalysis.sh,stopNeo4j.sh,compilations/*.sh,profiles/*.sh +# Requires domains/neo4j-management/setupNeo4j.sh,setupJQAssistant.sh,domains/neo4j-management/startNeo4j.sh,resetAndScanChanged.sh,prepareAnalysis.sh,domains/neo4j-management/stopNeo4j.sh,compilations/*.sh,profiles/*.sh # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) set -o errexit -o pipefail @@ -203,9 +203,9 @@ echo "${LOG_GROUP_END}" # Setup Tools echo "${LOG_GROUP_START}Setup Tools" -source "${SCRIPTS_DIR}/setupNeo4j.sh" +source "${DOMAINS_DIRECTORY}/neo4j-management/setupNeo4j.sh" source "${SCRIPTS_DIR}/setupJQAssistant.sh" -source "${SCRIPTS_DIR}/startNeo4j.sh" +source "${DOMAINS_DIRECTORY}/neo4j-management/startNeo4j.sh" echo "${LOG_GROUP_END}" # Scan and analyze artifacts when they were changed @@ -233,6 +233,6 @@ echo "${LOG_GROUP_START}Finishing Analysis" if ${keepRunning}; then echo "analyze: Neo4j will keep running (--keep-running is set)." else - source "${SCRIPTS_DIR}/stopNeo4j.sh" + source "${DOMAINS_DIRECTORY}/neo4j-management/stopNeo4j.sh" fi echo "${LOG_GROUP_END}" \ No newline at end of file diff --git a/scripts/runTests.sh b/scripts/runTests.sh index 695d8f64d..efa716516 100755 --- a/scripts/runTests.sh +++ b/scripts/runTests.sh @@ -15,6 +15,7 @@ LOG_GROUP_END=${LOG_GROUP_END:-"::endgroup::"} # Prefix to end a log group. Defa # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. # This way non-standard tools like readlink aren't needed. SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts +DOMAINS_DIRECTORY=${DOMAINS_DIRECTORY:-"${SCRIPTS_DIR}/../domains"} # Repository directory containing the domain scripts # echo "runTests: SCRIPTS_DIR=${SCRIPTS_DIR}" >&2 ## Run all test scripts without using a pipe to the while loop so that an @@ -30,4 +31,4 @@ while IFS= read -r test_script_file; do echo "runTests: $(date +'%Y-%m-%dT%H:%M:%S%z') Finished ${test_script_filename}" echo "${LOG_GROUP_END}" -done < <(find "${SCRIPTS_DIR}" -type f -name 'test*.sh') \ No newline at end of file +done < <(find "${SCRIPTS_DIR}" "${DOMAINS_DIR}" -type f -name 'test*.sh' | sort) \ No newline at end of file diff --git a/scripts/startNeo4j.sh b/scripts/startNeo4j.sh old mode 100755 new mode 100644 index 758638d9d..cd0906aaa --- a/scripts/startNeo4j.sh +++ b/scripts/startNeo4j.sh @@ -1,109 +1,5 @@ #!/usr/bin/env bash - -# Starts the local Neo4j Graph Database. - -# Note: Does nothing if the database is already running. -# Note: It requires Neo4j to be installed in the TOOLS_DIRECTORY. - -# Requires waitForNeo4jHttp.sh,operatingSystemFunctions.sh - -# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) -set -o errexit -o pipefail - -# Overrideable Defaults -NEO4J_EDITION=${NEO4J_EDITION:-"community"} # Choose "community" or "enterprise" -NEO4J_VERSION=${NEO4J_VERSION:-"2026.01.4"} -TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Get the tools directory (defaults to "tools") -NEO4J_HTTP_PORT=${NEO4J_HTTP_PORT:-"7474"} - -## Get this "scripts" directory if not already set -# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. -# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. -# This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts -echo "startNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" - -# Check if environment variable NEO4J_INITIAL_PASSWORD is set -if [ -z "${NEO4J_INITIAL_PASSWORD}" ]; then - echo "startNeo4j: Error: Requires environment variable NEO4J_INITIAL_PASSWORD to be set first. Use 'export NEO4J_INITIAL_PASSWORD='." - exit 1 -fi - -# Check if TOOLS_DIRECTORY variable is set -if [ -z "${TOOLS_DIRECTORY}" ]; then - echo "startNeo4j: Requires variable TOOLS_DIRECTORY to be set. If it is the current directory, then use a dot to reflect that." - exit 1 -fi - -# Detect Neo4j directory within the "tools" directory -neo4j_directory="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" # Default directory using environment variables -if [ ! -d "${TOOLS_DIRECTORY}/${neo4j_directory}" ] ; then - # Default directory doesn't exist. Try to find one with another version. - # This usually happens when Neo4j had been updated while a local project is still using an older version. - neo4j_directories=$(find "./${TOOLS_DIRECTORY}" -type d -name "neo4j-${NEO4J_EDITION}-*" | sort -r | head -n 1) - neo4j_directory=$(basename -- "$neo4j_directories") - echo "startNeo4j: Auto detected Neo4j directory within the tools directory: ${neo4j_directory}" -fi - -# Internal Constants -NEO4J_DIR="${TOOLS_DIRECTORY}/${neo4j_directory}" -NEO4J_DIR_WINDOWS="${TOOLS_DIRECTORY}\\${neo4j_directory}" -NEO4J_BIN="${NEO4J_DIR}/bin" -NEO4J_BIN_WINDOWS="${NEO4J_DIR_WINDOWS}\bin" - -# Check if Neo4j is installed -if [ -d "${NEO4J_BIN}" ] ; then - echo "startNeo4j: Using Neo4j binary directory ${NEO4J_BIN}" -else - echo "startNeo4j: Directory ${NEO4J_BIN} doesn't exist. Please run setupNeo4j.sh first." - exit 1 -fi - -# Include operation system function to for example detect Windows. -source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" - -# Include functions to check or wait for the database to be ready -source "${SCRIPTS_DIR}/waitForNeo4jHttpFunctions.sh" - -# Check if Neo4j is stopped (not running) using a temporary NEO4J_HOME environment variable that points to the current installation -isDatabaseReady=$(isDatabaseQueryable) -if [[ ${isDatabaseReady} == "false" ]]; then - echo "startNeo4j: Starting ${neo4j_directory} in ${NEO4J_DIR}" - - # Check if there is already a process that listens to the Neo4j HTTP port - if isWindows; then - echo "startNeo4j: Skipping detection of processes listening to port ${NEO4J_HTTP_PORT} on Windows" - else - port_listener_process_id=$( lsof -t -i:"${NEO4J_HTTP_PORT}" -sTCP:LISTEN || true ) - if [ -n "${port_listener_process_id}" ]; then - echo "startNeo4j: There is already a process that listens to port ${NEO4J_HTTP_PORT}" - ps -p "${port_listener_process_id}" - echo "startNeo4j: Use this command to stop it: kill -9 \$( lsof -t -i:${NEO4J_HTTP_PORT} -sTCP:LISTEN )" - exit 1 - fi - fi - - # Start Neo4j using a temporary NEO4J_HOME environment variable that points to the current installation - if isWindows; then - neo4jStartCommand="${NEO4J_BIN_WINDOWS}\neo4j.bat console --verbose" - # On Windows it is necessary to take the absolute full qualified path to Neo4j for the environment variable NEO4J_HOME. - # It also works without any environment variable but this would likely lead to ambiguity problems when there are multiple Neo4j instances installed. - # If the path is wrong content-wise this leads to a ClassNotFoundException. - # If the path is wrong syntactically there is an error while reading the plugins directory. - windowsCommandEnvironment="set NEO4J_HOME=%cd%\\${NEO4J_DIR_WINDOWS}&& echo NEO4J_HOME=!NEO4J_HOME!" - windowsCommand="${windowsCommandEnvironment}&&${neo4jStartCommand}" - - echo "startNeo4j: Starting Neo4j on Windows in a separate console window..." - echo "startNeo4j: The following Windows command is used: ${windowsCommand}" - echo "startNeo4j: IMPORTANT: Only close the console window when the scripts and your work is finished !" - - cmd //c start cmd //v //k "${windowsCommand}" - else - NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j start --verbose - fi - - waitUntilDatabaseIsQueryable - -else - echo "startNeo4j: ${neo4j_directory} already started" -fi \ No newline at end of file +# Deprecated: startNeo4j.sh has been moved to domains/neo4j-management/. +# This stub exists for backward compatibility only — it forwards all arguments to the domain implementation. +# New code should reference domains/neo4j-management/startNeo4j.sh directly. +source "$(dirname -- "${BASH_SOURCE[0]}")/../domains/neo4j-management/startNeo4j.sh" "${@}" diff --git a/scripts/stopNeo4j.sh b/scripts/stopNeo4j.sh old mode 100755 new mode 100644 index 2b291f77b..19836f0bd --- a/scripts/stopNeo4j.sh +++ b/scripts/stopNeo4j.sh @@ -1,109 +1,5 @@ #!/usr/bin/env bash - -# Stops the local Neo4j Graph Database. - -# Note: Does nothing if the database is already stopped. - -# Requires waitForNeo4jHttp.sh,operatingSystemFunctions.sh - -# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) -set -o errexit -o pipefail - -# Overrideable Defaults -NEO4J_EDITION=${NEO4J_EDITION:-"community"} # Choose "community" or "enterprise" -NEO4J_VERSION=${NEO4J_VERSION:-"2026.01.4"} -TOOLS_DIRECTORY=${TOOLS_DIRECTORY:-"tools"} # Get the tools directory (defaults to "tools") -NEO4J_HTTP_PORT=${NEO4J_HTTP_PORT:-"7474"} - -## Get this "scripts" directory if not already set -# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. -# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. -# This way non-standard tools like readlink aren't needed. -SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts -echo "stopNeo4j: SCRIPTS_DIR=$SCRIPTS_DIR" - -# Check if TOOLS_DIRECTORY variable is set -if [ -z "${TOOLS_DIRECTORY}" ]; then - echo "stopNeo4j: Requires variable TOOLS_DIRECTORY to be set. If it is the current directory, then use a dot to reflect that." - exit 1 -fi - -# Detect Neo4j directory within the "tools" directory -# If the version had been updated and a local project still uses the -neo4j_directory="neo4j-${NEO4J_EDITION}-${NEO4J_VERSION}" # Default directory using environment variables -if [ ! -d "${TOOLS_DIRECTORY}/${neo4j_directory}" ] ; then - # Default directory doesn't exist. Try to find one with another version. - # This usually happens when Neo4j had been updated while a local project is still using an older version. - neo4j_directories=$(find "./${TOOLS_DIRECTORY}" -type d -name "neo4j-${NEO4J_EDITION}-*" | sort -r | head -n 1) - neo4j_directory=$(basename -- "$neo4j_directories") - echo "stopNeo4j: Auto detected Neo4j directory within the tools directory: ${neo4j_directory}" -fi - -# Internal Constants -NEO4J_DIR="${TOOLS_DIRECTORY}/${neo4j_directory}" -NEO4J_BIN="${NEO4J_DIR}/bin" - -# Check if Neo4j is installed -if [ -d "${NEO4J_BIN}" ] ; then - echo "stopNeo4j: Using Neo4j binary directory ${NEO4J_BIN}" -else - echo "stopNeo4j: Directory ${NEO4J_BIN} doesn't exist. Please run setupNeo4j.sh first." - exit 1 -fi - -# Include operation system function to for example detect Windows like isWindows. -source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" - -# Include functions to check or wait for the database to be ready like isDatabaseQueryable. -source "${SCRIPTS_DIR}/waitForNeo4jHttpFunctions.sh" - -# Check if Neo4j is stopped (not running) using a temporary NEO4J_HOME environment variable that points to the current installation -isDatabaseReady=$(isDatabaseQueryable) -if [ "${isDatabaseReady}" = "false" ]; then - echo "stopNeo4j: ${neo4j_directory} already stopped" - exit 0 -else - if isWindows; then - echo "stopNeo4j: IMPORTANT on Windows: Please close the console window or stop the service manually where ${neo4j_directory} is running." - else - # Stop Neo4j using a temporary NEO4J_HOME environment variable that points to the current installation - NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j stop - fi -fi - -#Check if Neo4j is still not running using a temporary NEO4J_HOME environment variable that points to the current installation -isDatabaseReady=$(isDatabaseQueryable) -if [ "${isDatabaseReady}" = "false" ]; then - echo "stopNeo4j: Successfully stopped ${neo4j_directory}" -else - if ! isWindows; then - echo "stopNeo4j: ${neo4j_directory} still running. Something went wrong. Details see 'NEO4J_HOME=${NEO4J_DIR} ${NEO4J_BIN}/neo4j${scriptExtension} status'." - exit 1 - fi -fi - -# Check if there are still processes running that listen to the Neo4j HTTP port -if isWindows; then - echo "stopNeo4j: Skipping detection of processes listening to port ${NEO4J_HTTP_PORT} on Windows" -else - port_listener_process_ids=$( lsof -t -i:"${NEO4J_HTTP_PORT}" -sTCP:LISTEN 2>/dev/null || true ) - if [ -n "${port_listener_process_ids}" ]; then - echo "stopNeo4j: Gracefully terminating process(es) listening to port ${NEO4J_HTTP_PORT}" - # Display process info - echo "${port_listener_process_ids}" | tr '\n' ',' | sed 's/,$//' | xargs -I {} ps -p {} || true - # Try graceful shutdown first with SIGTERM on each PID - echo "${port_listener_process_ids}" | while read -r pid; do - [ -n "${pid}" ] && kill -TERM "${pid}" 2>/dev/null || true - done - sleep 20 - # Check if process(es) are still alive and force kill if necessary - echo "${port_listener_process_ids}" | while read -r pid; do - [ -n "${pid}" ] && kill -0 "${pid}" 2>/dev/null && { - echo "stopNeo4j: Process ${pid} still alive after SIGTERM — sending SIGKILL" - kill -KILL "${pid}" 2>/dev/null || true - } || true - done - else - echo "stopNeo4j: No processes listening to port ${NEO4J_HTTP_PORT} detected. Assuming Neo4j is stopped." - fi -fi \ No newline at end of file +# Deprecated: stopNeo4j.sh has been moved to domains/neo4j-management/. +# This stub exists for backward compatibility only — it forwards all arguments to the domain implementation. +# New code should reference domains/neo4j-management/stopNeo4j.sh directly. +source "$(dirname -- "${BASH_SOURCE[0]}")/../domains/neo4j-management/stopNeo4j.sh" "${@}" diff --git a/scripts/testAnalyzeDomainOption.sh b/scripts/testAnalyzeDomainOption.sh index 4d35d3858..1d0ef8d81 100755 --- a/scripts/testAnalyzeDomainOption.sh +++ b/scripts/testAnalyzeDomainOption.sh @@ -117,16 +117,23 @@ mkdir -p "${temporaryMinimalScriptsDirectory}/profiles" for placeholderScriptFile in \ "reports/compilations/AllReports.sh" \ "profiles/Default.sh" \ - "setupNeo4j.sh" \ "setupJQAssistant.sh" \ - "startNeo4j.sh" \ "resetAndScanChanged.sh" \ - "prepareAnalysis.sh" \ - "stopNeo4j.sh"; do + "prepareAnalysis.sh"; do printf '#!/usr/bin/env bash\n# Minimal placeholder script for testing - does nothing\n' \ > "${temporaryMinimalScriptsDirectory}/${placeholderScriptFile}" done +# Create placeholder scripts for the neo4j-management domain scripts now sourced from DOMAINS_DIRECTORY. +mkdir -p "${temporaryDomainsDirectory}/neo4j-management" +for placeholderDomainScriptFile in \ + "setupNeo4j.sh" \ + "startNeo4j.sh" \ + "stopNeo4j.sh"; do + printf '#!/usr/bin/env bash\n# Minimal placeholder script for testing - does nothing\n' \ + > "${temporaryDomainsDirectory}/neo4j-management/${placeholderDomainScriptFile}" +done + # -------- Test case 1 -------- test_case_number=1 echo ""