Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Documentation for MetricGardener #3045

Merged
merged 2 commits into from
Sep 21, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

- Change default behaviour of GitLogParser to use new subcommands [#3026](https://github.com/MaibornWolff/codecharta/pull/3026)

### Fixed 🐞

- Update ReadMe and GitHub pages for MetricGardener [#3045](https://github.com/MaibornWolff/codecharta/pull/3045)

## [1.106.1] - 2022-09-20

## Fixed 🐞
### Fixed 🐞

- CC-JSON Files not loaded on Safari browser [#3042](https://github.com/MaibornWolff/codecharta/pull/3042)
- Show loading spinners while loading a file [#2980](https://github.com/MaibornWolff/codecharta/pull/2980)
- Prevent clicking on not opened metric options in ribbon bar [#3029](https://github.com/MaibornWolff/codecharta/pull/3029)
- Set cursor to pointer on color settings panel of delta mode [#3029](https://github.com/MaibornWolff/codecharta/pull/3029)

## Chore 👨‍💻 👩‍💻
### Chore 👨‍💻 👩‍💻

- Throttle rendering and migrate codeMap.preRender.service to Angular [#2980](https://github.com/MaibornWolff/codecharta/pull/2980)

Expand Down
56 changes: 52 additions & 4 deletions analysis/import/MetricGardenerImporter/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
### Metric-Gardener Importer
# MetricGardener Importer

This importer receives a json-File generated by the Metric Gardener Importer as input
[metric-gardener ](https://github.com/MaibornWolff/metric-gardener/)and returns a cc.json file.
It is optional to generate a compressed cc.json file.
This importer allows to use metrics calculated by [MetricGardener](https://github.com/MaibornWolff/metric-gardener), a
multi-language code parser based on [tree-sitter](https://github.com/tree-sitter/tree-sitter). The importer can be used
to parse files locally or to just import a MetricGardener.json file and convert it into a regular CodeCharta.cc.json
file.

For more information on MetricGardener, like the supported languages, and command line options, refer to its
[README](https://github.com/MaibornWolff/metric-gardener#readme). You can also refer to the documentation in
our [GitHub Pages](https://maibornwolff.github.io/codecharta/docs/metricgardener-importer)

> Please note: MetricGardener is currently only compatible with NodeJS up to version 16.x. If you use NodeJS 18.x, you
> need to install version 16.x to use MetricGardener.

## Supported Metrics

- mcc
- functions
- classes
- lines_of_code
- comment_lines
- real_lines_of_code

## Usage of the MetricGardener Importer

| Parameter | description |
| ------------------------------- | ------------------------------------------------ |
| `FOLDER or FILE` | path for project folder or code file |
| `-j, --is-json-file` | Input file is already a MetricGardener JSON file |
| `-h, --help` | displays help |
| `-o, --outputFile=<outputFile>` | output File (or empty for stdout) |
| `-nc, --not-compressed` | save uncompressed output File |

```
ccsh metricgardenerimport [-nc] [-o=<outputFile>] [-j] FOLDER or FILE
```

## Examples

### Create a CodeCharta json file from local source code (metric-gardener is executed internally on the fly):

```
ccsh metricgardenerimport /path/to/source/code -o outfile.cc.json
```

### Create a CodeCharta json file by importing a given metric-gardener json file (run MetricGardener yourself):

For this MetricGardener needs to be installed on your system. Install it with `npm i -g metric-gardener`

```
npx metric-gardener parse /path/to/source/code -o mg_results.json
ccsh metricgardenerimport mg_results.json --is-json-file -o outfile.cc.json
```
13 changes: 9 additions & 4 deletions gh-pages/_docs/04-13-metricgardener.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ title: "MetricGardener Importer"
---

This importer allows to use metrics calculated by [MetricGardener](https://github.com/MaibornWolff/metric-gardener), a
multi-language code parser based on [tree-sitter](https://github.com/tree-sitter/tree-sitter).
multi-language code parser based on [tree-sitter](https://github.com/tree-sitter/tree-sitter). The importer can be used
to parse files locally or to just import a MetricGardener.json file and convert it into a regular CodeCharta.cc.json
file.

For more information on MetricGardener, like the supported languages, and command line options, refer to its
[README](https://github.com/MaibornWolff/metric-gardener#readme).

Expand All @@ -25,7 +28,7 @@ For more information on MetricGardener, like the supported languages, and comman
| Parameter | description |
| ------------------------------- | ------------------------------------------------ |
| `FOLDER or FILE` | path for project folder or code file |
| `-j,--is-json-file` | Input file is already a MetricGardener JSON file |
| `-j, --is-json-file` | Input file is already a MetricGardener JSON file |
| `-h, --help` | displays help |
| `-o, --outputFile=<outputFile>` | output File (or empty for stdout) |
| `-nc, --not-compressed` | save uncompressed output File |
Expand All @@ -36,13 +39,15 @@ For more information on MetricGardener, like the supported languages, and comman

## Examples

Automatic mode (ccsh runs MetricGardener internally):
### Create a CodeCharta json file from local source code (metric-gardener is executed internally on the fly):

```
ccsh metricgardenerimport /path/to/source/code -o outfile.cc.json
```

Manual mode (run MetricGardener yourself):
### Create a CodeCharta json file by importing a given metric-gardener json file (run MetricGardener yourself):

For this MetricGardener needs to be installed on your system. Install it with `npm i -g metric-gardener`

```
npx metric-gardener parse /path/to/source/code -o mg_results.json
Expand Down