Skip to content

Commit 91f4fb7

Browse files
committed
docs: update docs about docker #4222
1 parent 7085f63 commit 91f4fb7

File tree

7 files changed

+74
-16
lines changed

7 files changed

+74
-16
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ auth.txt
55
**/node-wrapper/public
66
.scannerwork
77

8+
#claude
9+
/.claude
10+
811
#gh-pages
912
gh-pages/vendor
1013

analysis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ To run it you can call `ccsh`
9494

9595
You can use Codecharta analysis in multiple ways. This section will deal with how to use the analysis as a standalone
9696
container. For information on how to use with docker compose, please check out
97-
our [docker compose documentation](https://maibornwolff.github.io/codecharta/docs/docker-containers/).
97+
our [docker compose documentation](https://maibornwolff.github.io/codecharta/docs/overview/dockerized).
9898
We assume that you already installed docker, if not, you have to do that before!
9999

100100
To containerize the analysis, please follow the below listed steps.

gh-pages/_docs/01-overview/01-introduction.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ understanding of code onto a visual and understandable map.
2323

2424
# Different parts of CodeCharta
2525

26-
We split CodeCharta into two different parts. The CCSH(CodeCharta Shell) which is the base for extracting metrics and
26+
We split CodeCharta into two different parts. The CCSH (CodeCharta Shell) which is the base for extracting metrics and
2727
our [Web Studio](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz&currentFilesAreSampleFiles=true&area=rloc&height=sonar_complexity&color=sonar_complexity) which is there to visualize these metrics as a city like map.
2828
From here you can move around, look at metrics and even 3D print them.
2929

@@ -38,9 +38,13 @@ You can use
3838
our [Web Studio](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz&currentFilesAreSampleFiles=true&area=rloc&height=sonar_complexity&color=sonar_complexity)
3939
to move around and check out our example maps that are already in place.
4040

41+
## Docker
42+
43+
Both the Web Studio and the CodeCharta Shell are available as docker containers. For more information, see [Docker Containers]({{site.docs_overview/dockerized}}).
44+
4145
## Installation
4246

43-
To install our [CodeCharta Shell]({{site.docs_overview}}/analysis), simply install it via npm:
47+
To install our [CodeCharta Shell]({{site.docs_overview}}/analysis), which is used to generate the code maps, simply install it via npm:
4448

4549
### Requirements
4650

gh-pages/_docs/01-overview/02-getting-started.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,28 @@ gallery:
1919

2020
Before you start doing anything, you should have a look at our [Web Studio](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz&currentFilesAreSampleFiles=true&area=rloc&height=sonar_complexity&color=sonar_complexity) you can try everything out yourself. You could also have a look at our [User Controls]({{site.docs_visualization}}/user-controls) to help you navigate.
2121

22+
You can also run the Web Studio offline by running:
23+
24+
```bash
25+
docker run -p 9000:80 codecharta/codecharta-visualization
26+
```
27+
This will automatically pull the docker container and start the Web Studio under `localhost:9000`
28+
29+
For more details about our docker images, see [Docker Containers]({{site.docs_overview/dockerized}}).
30+
2231
# CCSH (CodeCharta Shell)
2332

24-
After trying out the WebStudio, you may be wondering how to get your own project metrics into CodeCharta. You need to download our pre-build [CCSH (CodeCharta Shell)]({{site.docs_analysis}}/codecharta-shell), which will generate the metrics that can later be imported into our [Web Studio](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz&currentFilesAreSampleFiles=true&area=rloc&height=sonar_complexity&color=sonar_complexity).
33+
After trying out the WebStudio, you may be wondering how to get your own project metrics into CodeCharta. You can either download and install our pre-build [CCSH (CodeCharta Shell)]({{site.docs_analysis}}/codecharta-shell) or use our provided docker container. Both can be used to generate the metrics that can later be imported into our [Web Studio](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz&currentFilesAreSampleFiles=true&area=rloc&height=sonar_complexity&color=sonar_complexity).
34+
35+
## Docker
36+
37+
Using the CodeCharta Shell docker container, a simple analysis can be analysis can be executed in one command:
38+
```bash
39+
docker run -v .:/mnt/src codecharta/codecharta-analysis bash -c 'git config --global --add safe.directory /mnt/src; cd /mnt/src/; simplecc.sh create tutorial'
40+
```
41+
Simply run this command in the directory you want to analyze. It will automatically pull the docker container and start the `simplecc.sh` script, which uses a combination of different analyzers to generate a well-rounded code map.
42+
43+
For more details about our docker images, see [Docker Containers]({{site.docs_overview/dockerized}})
2544

2645
## Installation
2746

@@ -43,12 +62,12 @@ $ ccsh -h
4362
Now you need to decide where you want to get your metrics from. Every parser and importer has their own metrics that can be exported.
4463
Checkout [Analysis]({{site.docs_overview}}/analysis) to see an overview.
4564

46-
In this example we will use our [Raw Text Parser]({{site.docs_parser}}/raw-text) as it works on nearly every format.
65+
In this example we will use our [Unified Parser]({{site.docs_parser}}/unified) as it works on nearly every format.
4766

4867
```bash
4968
# -o output file
5069
# <path> enter a path to your project or a file you want to analyze
51-
$ ccsh rawtextparser -o=tutorial <path/to/your/project>
70+
$ ccsh unifiedparser -o=tutorial <path/to/your/project>
5271
# done :)!
5372
```
5473

gh-pages/_docs/01-overview/05-dockerized.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,44 @@ toc_sticky: true
77
toc_label: "Jump to Section"
88
---
99

10-
CodeCharta also comes as a full Docker environment, where all supported tools come pre-installed. To start all
11-
containers, you can type `docker compose pull && docker compose up --detach` while you're in the same directory as our
12-
docker-compose.yml
10+
CodeCharta also comes as a full Docker environment, where all supported tools come pre-installed.
11+
12+
Both the visualization and the analysis are published on Docker Hub:
13+
- [codecharta-visualization](https://hub.docker.com/r/codecharta/codecharta-visualization/)
14+
- [codecharta-analysis](https://hub.docker.com/r/codecharta/codecharta-analysis)
15+
16+
### Visualization
17+
Can be started by running:
18+
```bash
19+
docker run -p 9000:80 codecharta/codecharta-visualization
20+
```
21+
After running this, the visualization is accessible under `localhost:9000`
22+
23+
### Analysis
24+
As the analysis has multiple available tools, there are different ways on how it can be used:
25+
1. Run a simple analysis with one command:
26+
```bash
27+
docker run -v .:/mnt/src codecharta/codecharta-analysis bash -c 'git config --global --add safe.directory /mnt/src; cd /mnt/src/; simplecc.sh create <YourProjectName>'
28+
```
29+
2. Start a bash shell inside the docker container to use the codecharta shell or any other of the tools installed in
30+
the container via the command line:
31+
```bash
32+
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis bash
33+
```
34+
3. Start the interactive mode inside the docker container, which helps to guide you through the parsing/analyzing process:
35+
```bash
36+
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh
37+
```
38+
4. Directly execute a specific analyzer in the container (e.g. [Unified Parser]({{site.docs_parser}}/unified)):
39+
```bash
40+
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh unifiedparser .
41+
```
42+
43+
NOTE: Your current directory will be used for the analysis if not specified otherwise.
44+
45+
# Docker images from local CodeCharta instance
46+
47+
If you have the CodeCharta repo cloned locally, you can start all containers, by typing `docker compose pull && docker compose up--detach` while you're in the same directory as our docker-compose.yml
1348
1449
## The Container Landscape
1550
@@ -24,12 +59,6 @@ docker-compose.yml
2459
All containers share a volume for the quick transfer of files. You can find it under /mnt/data in each container.
2560
Please note that you will need to copy finished cc.json files to **your** hard-drive to open them in Visualization.
2661
27-
# Docker Hub Install
28-
29-
Both the visualization and the analysis are published on Docker Hub:
30-
- [codecharta-visualization](https://hub.docker.com/r/codecharta/codecharta-visualization/)
31-
- [codecharta-analysis](https://hub.docker.com/r/codecharta/codecharta-analysis)
32-
3362
## Visualization
3463
3564
```bash

gh-pages/_docs/02-visualization/01-web-studio.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gallery:
1515
title: "Visualization"
1616
---
1717

18-
Our Web Studio allows you to import metrics from the CCSH(CodeCharta shell) and visualize them.
18+
Our Web Studio allows you to import metrics from the CCSH (CodeCharta shell) and visualize them.
1919

2020
> Please note that CodeCharta runs only on your client. No metrics that you analyze or visualize will ever leave your computer unless you distribute it yourself.
2121
@@ -40,3 +40,5 @@ $ npm i
4040
# Start the dev server
4141
$ npm run dev
4242
```
43+
44+
You can also run it locally via docker. For more information, see [Docker Containers](https://codecharta.com/docs/overview/dockerized)

gh-pages/_docs/05-parser/05-unified.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ CodeCharta. It generates either a cc.json or a csv file.
4141
| Number of functions | The number of functions and methods in a file |
4242
| Lines of code (LOC) | Lines of code including empty lines and comments |
4343
| Real lines of code (RLOC) | Number of lines that contain at least one character which is neither a whitespace nor a tabulation nor part of a comment |
44+
4445
Some metrics are calculated on a per-function basis rather than per-file. Each of these metrics has max, min, mean and median values for each file.
4546

4647
| Metric per function | Description |

0 commit comments

Comments
 (0)