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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ auth.txt
**/node-wrapper/public
.scannerwork

#claude
/.claude

#gh-pages
gh-pages/vendor

Expand Down
2 changes: 1 addition & 1 deletion analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ To run it you can call `ccsh`

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

To containerize the analysis, please follow the below listed steps.
Expand Down
8 changes: 6 additions & 2 deletions gh-pages/_docs/01-overview/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ understanding of code onto a visual and understandable map.

# Different parts of CodeCharta

We split CodeCharta into two different parts. The CCSH(CodeCharta Shell) which is the base for extracting metrics and
We split CodeCharta into two different parts. The CCSH (CodeCharta Shell) which is the base for extracting metrics and
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.
From here you can move around, look at metrics and even 3D print them.

Expand All @@ -38,9 +38,13 @@ You can use
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)
to move around and check out our example maps that are already in place.

## Docker

Both the Web Studio and the CodeCharta Shell are available as docker containers. For more information, see [Docker Containers]({{site.docs_overview/dockerized}}).

## Installation

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

### Requirements

Expand Down
25 changes: 22 additions & 3 deletions gh-pages/_docs/01-overview/02-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,28 @@ gallery:

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.

You can also run the Web Studio offline by running:

```bash
docker run -p 9000:80 codecharta/codecharta-visualization
```
This will automatically pull the docker container and start the Web Studio under `localhost:9000`

For more details about our docker images, see [Docker Containers]({{site.docs_overview/dockerized}}).

# CCSH (CodeCharta Shell)

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).
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).

## Docker

Using the CodeCharta Shell docker container, a simple analysis can be analysis can be executed in one command:
```bash
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'
```
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.

For more details about our docker images, see [Docker Containers]({{site.docs_overview/dockerized}})

## Installation

Expand All @@ -43,12 +62,12 @@ $ ccsh -h
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.
Checkout [Analysis]({{site.docs_overview}}/analysis) to see an overview.

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

```bash
# -o output file
# <path> enter a path to your project or a file you want to analyze
$ ccsh rawtextparser -o=tutorial <path/to/your/project>
$ ccsh unifiedparser -o=tutorial <path/to/your/project>
# done :)!
```

Expand Down
47 changes: 38 additions & 9 deletions gh-pages/_docs/01-overview/05-dockerized.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,44 @@ toc_sticky: true
toc_label: "Jump to Section"
---

CodeCharta also comes as a full Docker environment, where all supported tools come pre-installed. To start all
containers, you can type `docker compose pull && docker compose up --detach` while you're in the same directory as our
docker-compose.yml
CodeCharta also comes as a full Docker environment, where all supported tools come pre-installed.

Both the visualization and the analysis are published on Docker Hub:
- [codecharta-visualization](https://hub.docker.com/r/codecharta/codecharta-visualization/)
- [codecharta-analysis](https://hub.docker.com/r/codecharta/codecharta-analysis)

### Visualization
Can be started by running:
```bash
docker run -p 9000:80 codecharta/codecharta-visualization
```
After running this, the visualization is accessible under `localhost:9000`

### Analysis
As the analysis has multiple available tools, there are different ways on how it can be used:
1. Run a simple analysis with one command:
```bash
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>'
```
2. Start a bash shell inside the docker container to use the codecharta shell or any other of the tools installed in
the container via the command line:
```bash
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis bash
```
3. Start the interactive mode inside the docker container, which helps to guide you through the parsing/analyzing process:
```bash
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh
```
4. Directly execute a specific analyzer in the container (e.g. [Unified Parser]({{site.docs_parser}}/unified)):
```bash
docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh unifiedparser .
```

NOTE: Your current directory will be used for the analysis if not specified otherwise.

# Docker images from local CodeCharta instance

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

## The Container Landscape

Expand All @@ -24,12 +59,6 @@ docker-compose.yml
All containers share a volume for the quick transfer of files. You can find it under /mnt/data in each container.
Please note that you will need to copy finished cc.json files to **your** hard-drive to open them in Visualization.

# Docker Hub Install

Both the visualization and the analysis are published on Docker Hub:
- [codecharta-visualization](https://hub.docker.com/r/codecharta/codecharta-visualization/)
- [codecharta-analysis](https://hub.docker.com/r/codecharta/codecharta-analysis)

## Visualization

```bash
Expand Down
4 changes: 3 additions & 1 deletion gh-pages/_docs/02-visualization/01-web-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gallery:
title: "Visualization"
---

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

> 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.

Expand All @@ -40,3 +40,5 @@ $ npm i
# Start the dev server
$ npm run dev
```

You can also run it locally via docker. For more information, see [Docker Containers](https://codecharta.com/docs/overview/dockerized)
1 change: 1 addition & 0 deletions gh-pages/_docs/05-parser/05-unified.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CodeCharta. It generates either a cc.json or a csv file.
| Number of functions | The number of functions and methods in a file |
| Lines of code (LOC) | Lines of code including empty lines and comments |
| 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 |

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.

| Metric per function | Description |
Expand Down