Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'COMMANDS.md'
- 'GETTING_STARTED.md'
- 'INTEGRATION.md'
- '.github/workflows/check-links-in-documentation.yml' # also run when this file was changed
- '.github/workflows/internal-check-links-in-documentation.yml' # also run when this file was changed
schedule:
- cron: "15 6 1 * *" # On the first day of each month at 6:15 o'clock

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/internal-check-renovate-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
# Only watch root level Renovate configuration changes
paths:
- 'renovate.json*'
- '.github/workflows/internal-check-renovate-config.yml' # or when this file changed

jobs:
reports:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/internal-cypher-reference-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- main
paths:
- '**/*.cypher' # Only run when cypher files changed
- '.github/workflows/cypher-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed
pull_request:
branches:
- main
paths:
- '**/*.cypher' # Only run when cypher files changed
- '.github/workflows/cypher-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed

jobs:
reports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- main
paths:
- '**/*.sh' # Only run when script files changed
- '.github/workflows/environment-variables-reference-documentation.yml' # or when this file was changed
- '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed
pull_request:
branches:
- main
paths:
- '**/*.sh' # Only run when script files changed
- '.github/workflows/environment-variables-reference-documentation.yml' # or when this file was changed
- '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed

jobs:
reports:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/internal-java-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- 'renovate.json'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/typescript-code-analysis.yml'
- '.github/workflows/internal-typescript-code-analysis.yml'
- '.github/workflows/*documentation.yml'
pull_request:
branches:
Expand All @@ -35,7 +35,7 @@ on:
- 'renovate.json'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/typescript-code-analysis.yml'
- '.github/workflows/internal-typescript-code-analysis.yml'
- '.github/workflows/*documentation.yml'

# Requires the secret NEO4J_INITIAL_PASSWORD to be configured
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/internal-report-reference-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- 'results/**' # Only run results have been updates
- '!results/*.md' # Ignore when report reference documentation itself changes
- '.github/workflows/report-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-report-reference-documentation.yml' # or when this file was changed
pull_request:
branches:
- main
paths:
- 'results/**' # Only run results have been updates
- '!results/*.md' # Ignore when report reference documentation itself changes
- '.github/workflows/report-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-report-reference-documentation.yml' # or when this file was changed

jobs:
reports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- main
paths:
- '**/*.sh' # Only run when script files changed
- '.github/workflows/scripts-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed
pull_request:
branches:
- main
paths:
- '**/*.sh' # Only run when script files changed
- '.github/workflows/scripts-reference-documentation.yml' # or when this file was changed
- '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed

jobs:
reports:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/internal-typescript-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- 'renovate.json'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/java-code-analysis.yml'
- '.github/workflows/internal-java-code-analysis.yml'
- '.github/workflows/*documentation.yml'
pull_request:
branches:
Expand All @@ -35,7 +35,7 @@ on:
- 'renovate.json'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/java-code-analysis.yml'
- '.github/workflows/internal-java-code-analysis.yml'
- '.github/workflows/*documentation.yml'

jobs:
Expand Down Expand Up @@ -106,6 +106,7 @@ jobs:
with:
name: ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
path: ./temp/${{ steps.set-analysis-name.outputs.analysis-name }}/source
include-hidden-files: true
if-no-files-found: error
retention-days: 1

Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/public-analyze-code-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
The name of the sources uploaded with 'actions/upload-artifact'
containing the content of the 'source' directory for the analysis.
Also supports sub-folders for multiple source code bases.
Please use 'include-hidden-files: true' if you also want to upload the git history.
required: false
type: string
default: ''
Expand Down Expand Up @@ -70,7 +71,11 @@ jobs:
- name: Assure that either artifacts-upload-name or sources-upload-name is set
if: inputs.artifacts-upload-name == '' && inputs.sources-upload-name == ''
run: echo "Please specify either the input parameter 'artifacts-upload-name' or 'sources-upload-name'."; exit 1


- name: (Debug) Log all variables
if: runner.debug == '1'
run: echo "DEBUG log all variables -> $GITHUB_CONTEXT"

- name: Checkout code-graph-analysis-pipeline
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
Expand Down Expand Up @@ -142,6 +147,12 @@ jobs:
name: ${{ inputs.artifacts-upload-name }}
path: temp/${{ inputs.analysis-name }}/artifacts

- name: (Debug) Log folder structure of temp directory
if: runner.debug == '1'
working-directory: temp
run: |
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

- name: (Code Analysis) Analyze ${{ inputs.analysis-name }}
working-directory: temp/${{ inputs.analysis-name }}
# Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed
Expand Down
8 changes: 4 additions & 4 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To run all analysis steps simple execute the following command:

👉 See [scripts/examples/analyzeAxonFramework.sh](./scripts/examples/analyzeAxonFramework.sh) as an example script that combines all the above steps for a Java Project.
👉 See [scripts/examples/analyzeReactRouter.sh](./scripts/examples/analyzeReactRouter.sh) as an example script that combines all the above steps for a Typescript Project.
👉 See [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) on how to do this within a GitHub Actions Workflow.
👉 See [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) on how to do this within a GitHub Actions Workflow.

### Command Line Options

Expand Down Expand Up @@ -152,7 +152,7 @@ Change into the [scripts](./scripts/) directory e.g. with `cd scripts` and then
Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateCsvReportReference.sh](./scripts/documentation/generateCsvReportReference.sh) with the following command:

👉**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh)
which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally.
which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally.

```script
./../scripts/documentation/generateCsvReportReference.sh
Expand All @@ -163,7 +163,7 @@ which is included in the pipeline [java-code-analysis.yml](.github/workflows/jav
Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateJupyterReportReference.sh](./scripts/documentation/generateJupyterReportReference.sh) with the following command:

👉**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh)
which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally.
which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally.

```script
./../scripts/documentation/generateJupyterReportReference.sh
Expand All @@ -174,7 +174,7 @@ which is included in the pipeline [java-code-analysis.yml](.github/workflows/jav
Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateImageReference.sh](./scripts/documentation/generateImageReference.sh) with the following command:

👉**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh)
which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally.
which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally.

```script
./../scripts/documentation/generateImageReference.sh
Expand Down
2 changes: 1 addition & 1 deletion GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ Use these optional command line options as needed:

## GitHub Actions

👉 See [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) on how to do this within a GitHub Actions Workflow.
👉 See [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) on how to do this within a GitHub Actions Workflow.
5 changes: 3 additions & 2 deletions INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The workflow requires the names of the uploaded artifacts (source code and build

You can find examples in:

- [internal-java-code-analysis.yml](./.github/workflows/internal-java-code-analysis.yml)
- [internal-typescript-code-analysis.yml](./.github/workflows/internal-typescript-code-analysis.yml)
- [internal-internal-java-code-analysis.yml](./.github/workflows/internal-internal-java-code-analysis.yml)
- [internal-internal-typescript-code-analysis.yml](./.github/workflows/internal-internal-typescript-code-analysis.yml)

:warning: Note: Workflows with names starting with `internal-` are private and should not be used outside this repository. They may change at any time without notice.

Expand All @@ -30,6 +30,7 @@ The workflow parameters are as follows:
- **analysis-name**: The name of the project to analyze. Example: MyProject-1.0.0. This parameter is required and should be a string.
- **artifacts-upload-name**: The name of the artifacts uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'artifacts' directory for the analysis. This is used to analyze Java JARs, WARs, EARs, etc. This parameter is optional and defaults to an empty string.
- **sources-upload-name**: The name of the sources uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'source' directory for the analysis. It also supports sub-folders for multiple source code bases. This parameter is optional and defaults to an empty string.
Please use 'include-hidden-files: true' if you also want to upload the git history.
- **ref**: The branch, tag, or SHA of the code-graph-analysis-pipeline to checkout. This parameter is optional and defaults to "main".
- **analysis-arguments**: The arguments to pass to the analysis script. This parameter is optional and defaults to '--profile Neo4jv5-low-memory'.
- **typescript-scan-heap-memory**: The heap memory size in MB to use for the TypeScript code scans. This value is only used for the TypeScript code scans and is ignored for other scans. This parameter is optional and defaults to '4096'.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Contained within this repository is a comprehensive and automated code graph ana
- Analyze static code structure as a graph
- Supports Java Code Analysis
- **🌟New🌟:** Supports Typescript Code Analysis (experimental)
- Fully automated [pipeline for Java](./.github/workflows/java-code-analysis.yml) from tool installation to report generation
- Fully automated [pipeline for Typescript](./.github/workflows/typescript-code-analysis.yml) from tool installation to report generation
- Fully automated [pipeline for Java](./.github/workflows/internal-java-code-analysis.yml) from tool installation to report generation
- Fully automated [pipeline for Typescript](./.github/workflows/internal-typescript-code-analysis.yml) from tool installation to report generation
- Fully automated [local run](./GETTING_STARTED.md)
- Easy integratable in your [continuous integration pipeline](./INTEGRATION.md)
- More than 130 CSV reports for dependencies, metrics, cycles, annotations, algorithms and many more
Expand Down Expand Up @@ -113,7 +113,7 @@ Currently (2025), only GitHub Actions are supported.

## :building_construction: Pipeline and Tools

The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) utilizes [GitHub Actions](https://docs.github.com/de/actions) to automate the whole analysis process:
The [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) utilizes [GitHub Actions](https://docs.github.com/de/actions) to automate the whole analysis process:

- Use [GitHub Actions](https://docs.github.com/de/actions) Linux Runner
- [Checkout GIT Repository](https://github.com/actions/checkout)
Expand All @@ -139,7 +139,7 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym
- [Graph Visualization](./graph-visualization/README.md) uses [node.js](https://nodejs.org/de) and the dependencies listed in [package.json](./graph-visualization/package.json).
- [HPCC-Systems (High Performance Computing Cluster) Web-Assembly (JavaScript)](https://github.com/hpcc-systems/hpcc-js-wasm) containing a wrapper for GraphViz to visualize graph structures.
- [GraphViz](https://gitlab.com/graphviz/graphviz) for CLI Graph Visualization
- [Check links in markdown documentation (GitHub workflow)](./.github/workflows/check-links-in-documentation.yml) uses [markdown-link-check](https://github.com/tcort/markdown-link-check).
- [Check links in markdown documentation (GitHub workflow)](./.github/workflows/internal-check-links-in-documentation.yml) uses [markdown-link-check](https://github.com/tcort/markdown-link-check).

**Big shout-out** 📣 to all the creators and contributors of these great libraries 👍. Projects like this wouldn't be possible without them. Feel free to [create an issue](https://github.com/JohT/code-graph-analysis-pipeline/issues/new/choose) if something is missing or wrong in the list.

Expand Down Expand Up @@ -193,7 +193,7 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym

- How can i analyze a different code basis automatically?
👉 Create a new download script like the ones in the [scripts/downloader](./scripts/downloader/) directory. Take for example [downloadAxonFramework.sh](./scripts/downloader/downloadAxonFramework.sh) as a reference for Java projects and [downloadReactRouter.sh](./scripts/downloader/downloadReactRouter.sh) as a reference for Typescript projects.
👉 After downloading, run [analyze.sh](./scripts/analysis/analyze.sh). You can find these steps also in the [pipeline](./.github/workflows/java-code-analysis.yml) as a reference.
👉 After downloading, run [analyze.sh](./scripts/analysis/analyze.sh). You can find these steps also in the [pipeline](./.github/workflows/internal-java-code-analysis.yml) as a reference.

- How can i trigger a full re-scan of all artifacts?
👉 Delete the file `artifactsChangeDetectionHash.txt` in the `artifacts` directory.
Expand Down
Loading