https://github.com/svdo/source-code-metrics
Collects and presents source code metrics from different sources
https://github.com/svdo/source-code-metrics
clojure metrics
Last synced: 10 months ago
JSON representation
Collects and presents source code metrics from different sources
- Host: GitHub
- URL: https://github.com/svdo/source-code-metrics
- Owner: svdo
- License: mit
- Created: 2019-06-28T13:49:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T07:14:16.000Z (about 6 years ago)
- Last Synced: 2025-02-03T14:48:29.475Z (12 months ago)
- Topics: clojure, metrics
- Language: Clojure
- Size: 113 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Metrics
=======
This program can automatically collect metrics for a given project.
Purpose
-------
This project should be viewed as a personal tool, not necessarily intended
for other purposes than mine. For me, it's both useful and a great vehicle
to learn Clojure better. Having said that, you're of course welcome to
use it if you see value in it.
Configuration
-------------
The file `config.edn` contains configurable things, including the SonarQube
project key. The token must be generated in SonarQube (My Account -> Security
-> Generate Token). A second token that is needed is for GitLab. You can
generate that token by navigating in GitLab to Account -> Settings ->
Access Tokens. Enable the scope 'api' for this token.
In order to keep your secrets safe, you may should put them in
`config.local.edn` instead of `config.edn`. The two maps are merged, where
the anything in the `local` one will overwrite the other. The file
`config.local.edn` is ignored by git, so this way you don't have to fear
accidentally committing your secrets to git. So before running this,
you should create `config.local.edn` and put all the Gitlab and SonarQube
information in there by following the instructions in `config.edn`. For example,
your final `config.local.edn` when you want to report on two different projects
should look like this:
```edn
{:sonar/base-url "https://sonar.example.com"
:gitlab/base-url "https://gitlab.example.com/api/v4"
:report/projects
[{:sonar/token "abcdefghijklmnopqrstuvwxyz"
:sonar/project-id "my.project-id"
:gitlab/token "aBCdeFGHijkLMN"
:gitlab/project-id 42}
{:sonar/token "zyxwvutsrqponmlkjihgfedcba"
:sonar/project-id "my.other-project-id"
:gitlab/token "NMLkjiHGFedCBa"
:gitlab/project-id 24}]}
```
Running
-------
```bash
./run.sh
```
Unit Tests
----------
```bash
./test.sh --watch
```