Skip to content

Commit

Permalink
update ver1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-colussi-sonarsource committed Jul 12, 2024
2 parents 6d09b09 + b81810a commit 5427b8f
Show file tree
Hide file tree
Showing 18 changed files with 1,817 additions and 400 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Docker/dockerbuid.sh
dockerbuild.sh
.cloc_file_load
.scannerwork/
scan1.sh
Logs/*
133 changes: 129 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

GoLC The tool analyzes your repositories and identifies the largest branch of each repository, counting the total number of lines of code per language for that branch. At the end of the analysis, a text and PDF report is generated, along with a JSON results file for each repository.It starts an HTTP service to display an HTML page with the results.

> This version ver1.0.3 is available for Bitbucket Cloud , Bitbucket DC, GitHub , GitLab , Azure DevOps and Files.A Docker version is available.
> This version ver1.0.4 is available for Bitbucket Cloud , Bitbucket DC, GitHub , GitLab , Azure DevOps and Files.A Docker version is available.
---
## Installation

You can install from the stable release by clicking [here](https://github.com/colussim/GoLC/releases/tag/V1.0.3)
You can install from the stable release by clicking [here](https://github.com/colussim/GoLC/releases/tag/V1.0.4)

## Prerequisites

Expand Down Expand Up @@ -348,9 +348,9 @@ Extracting files from repo : testempty
🔎 Analyse Report ...
✅ Number of Repository analyzed in Organization <sonar-demo> is 11
✅ Number of Repository analyzed in Organization <techlabsnews> is 11
✅ The repository with the largest line of code is in project <CLOC> the repo name is <gcloc> with <2.05M> lines of code
✅ The total sum of lines of code in Organization <sonar-demo> is : 2.06M Lines of Code
✅ The total sum of lines of code in Organization <techlabsnews> is : 2.06M Lines of Code
✅ Reports are located in the <'Results'> directory
Expand All @@ -363,6 +363,39 @@ $:>
```
✅ Run on Windows
For execution on Windows, it is preferable to use PowerShell.
```
PS C:\Users\ecadmin\golc> .\golc.exe -devops File
✅ Using configuration for DevOps platform 'File'
❗️ Directory <'C:\Users\ecadmin\golc\Results'> already exists. Do you want to delete it? (y/n): y
❗️ Do you want to create a backup of the directory before deleting? (y/n): n
🔎 Analysis of Directories ...
✅ json report exported to Results\Result_sonar-golc.json
✅ 1 The directory <c:\Users\ecadmin\Picktalk> has been analyzed
🔎 Analyse Report ...
✅ Number of Directory analyzed in Organization <test> is 1
✅ The total sum of lines of code in Organization <test> is : 41.48K Lines of Code
✅ Reports are located in the <'Results'> directory
✅ Time elapsed : 00:00:02
ℹ️ To generate and visualize results on a web interface, follow these steps:
✅ run : ResultsAll
PS C:\Users\ecadmin\sonar-golc>
```
✅ Run Report
To generate a comprehensive PDF report and view the results on a web interface, you need to launch the '**ResultsAll**' program.
Expand Down Expand Up @@ -466,3 +499,95 @@ Running in Docker mode
✅ Server started on http://localhost:8090
✅ please type < Ctrl+C> to stop the server
```
✅ Run Report
Now we can start generating the report with the **resultsall** container.
You need to map the volume previously used for the analysis and map an available port for web access.
```
:> docker run --rm -p 8090:8090 -v /custom/Results_volume:/app/Results resultsall:arm64-1.0.4
✅ Results analysis recorded in Results/code_lines_by_language.json
✅ PDF generated successfully!
✅ Launching web visualization...
✅ Server started on http://localhost:8090
✅ please type < Ctrl+C> to stop the server
```
## Execution Log
The application generates a log file named `Logs.log` in the current directory. This log file records all the steps of the GoLC execution process, providing detailed information about the application's runtime behavior.

### Location
The log file is created in directory `Logs`, is placed in the following path: `<GoLCHome/Logs>`.

### Usage
You can refer to this log file to troubleshoot issues, monitor the application's execution, and understand its internal processes.
❗️ At each execution the file is deleted
### Example Log Entry
```
[2024-07-11 17:22:52] INFO ✅ Using configuration for DevOps platform 'Github'
[2024-07-11 17:22:55] INFO 🔎 Analysis of devops platform objects ...
Repos saved successfully!
[2024-07-11 17:22:56] INFO ✅ The number of Repo(s) found is: 50
[2024-07-11 17:22:57] INFO ✅ 1 Repo: sonar-aws-cicd-tutorial - Number of branches: 1 - largest Branch: main
[2024-07-11 17:22:59] INFO ✅ 2 Repo: sonar-golc - Number of branches: 1 - largest Branch: ver1.0.3
[2024-07-11 17:22:59] INFO ✅ 3 Repo: jenkins-docker - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:00] INFO ✅ 4 Repo: abapGit - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:01] INFO ✅ 5 Repo: abap2UI5 - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:02] INFO ✅ 6 Repo: abap-cheat-sheets - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:03] INFO ✅ 7 Repo: Container_Architecture - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:04] INFO ✅ 8 Repo: k8s-helm-sq-key - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:04] INFO ✅ 9 Repo: k8s-hpa-sonarqubedce - Number of branches: 1 - largest Branch: main
[2024-07-11 17:23:05] INFO ✅ 10 Repo: GitHub-Monorepo-Example - Number of branches: 1 - largest Branch: master
............
✅ Result saved successfully!
[2024-07-11 17:23:35] INFO ✅ The largest Repository is <sonar-aws-cicd-tutorial> in the organization <XXXXXXXXXXXXXX> with the branch <main>
[2024-07-11 17:23:35] INFO ✅ Total Repositories that will be analyzed: 49 - Find empty : 1 - Excluded : 0 - Archived : 0
[2024-07-11 17:23:35] INFO ✅ Total Branches that will be analyzed: 49
[2024-07-11 17:23:35] INFO 🔎 Analysis of Repos ...
Waiting for workers...
[2024-07✅ json report exported to /XXXXXXX/sonar-golc/Results/Result_SonarSource-Demos_employee-api_main.json
[2024-07-11 17:23:36] INFO ✅ 2 The repository <employee-api> has been analyzed
Waiting for workers...
[2024-07✅ json report exported to /XXXXXXX/sonar-golc/Results/Result_SonarSource-Demos_jenkins-docker_main.json
[2024-07-11 17:23:36] INFO ✅ 3 The repository <jenkins-docker> has been analyzed
............
[2024-07-11 17:27:20] INFO 🔎 Analyse Report ...
[2024-07-11 17:27:20] INFO ✅ Number of Repository analyzed in Organization <XXXXXXXXXXXXXX> is 49
[2024-07-11 17:27:20] INFO ✅ The total sum of lines of code in Organization <XXXXXXXXXXXXXX> is : 5.62M Lines of Code
[2024-07-11 17:27:20] INFO ✅ Reports are located in the <'Results'> directory
[2024-07-11 17:27:20] INFO ✅ Time elapsed : 00:02:24
[2024-07-11 17:27:20] INFO ℹ️ To generate and visualize results on a web interface, follow these steps:
[2024-07-11 17:27:20] INFO ✅ run : ResultsAll
```
## Future Features
We are continuously working to enhance and expand the functionality of our application. Here are some of the upcoming features you can look forward to:
- **GitLab On-Premise Support**: We plan to add support for GitLab on-premise instances, allowing users to seamlessly integrate their self-hosted GitLab repositories with our application.
- **Improved Exclusion Patterns**: Enhancements to the exclusion patterns to provide more precise and flexible control over what is included or excluded in various operations.
- **Additional Integrations**: Beyond GitLab, we are exploring support for other platforms and services to broaden the scope of our integrations and offer more flexibility to our users.
- **Improved User Interface**: Enhancements to the user interface to provide a more intuitive and user-friendly experience.
- **Performance Optimizations**: Ongoing efforts to optimize the performance and scalability of the application to handle larger workloads more efficiently.
Stay tuned for updates as we roll out these new features and improvements!
3 changes: 3 additions & 0 deletions config_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
"FileLoad":".cloc_file_load"

}
},
"Logging": {
"Level": "debug"
}
}

Expand Down
60 changes: 31 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,52 @@ go 1.21

require (
github.com/briandowns/spinner v1.18.1
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.12.0
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-github/v39 v39.2.0
github.com/google/go-github/v62 v62.0.0
github.com/hashicorp/go-getter v1.7.0
github.com/jung-kurt/gofpdf v1.16.2
github.com/ktrysmt/go-bitbucket v0.9.80
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/microsoft/azure-devops-go-api/azuredevops/v7 v7.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/schollz/progressbar/v3 v3.8.6
github.com/sirupsen/logrus v1.9.0
github.com/wcharczuk/go-chart v2.0.1+incompatible
github.com/wcharczuk/go-chart/v2 v2.1.1
github.com/xanzy/go-gitlab v0.105.0
golang.org/x/oauth2 v0.20.0
)

require (
cloud.google.com/go v0.104.0 // indirect
cloud.google.com/go/compute v1.10.0 // indirect
cloud.google.com/go/iam v0.5.0 // indirect
cloud.google.com/go/storage v1.27.0 // indirect
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/blend/go-sdk v1.20220411.3 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cweill/gotests v1.6.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git v4.7.0+incompatible // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
Expand All @@ -53,12 +58,9 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/ktrysmt/go-bitbucket v0.9.80 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 // indirect
github.com/microsoft/azure-devops-go-api/azuredevops/v7 v7.1.0 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
Expand All @@ -67,12 +69,14 @@ require (
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xanzy/go-gitlab v0.105.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opencensus.io v0.23.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/mod v0.18.0 // indirect
Expand All @@ -81,15 +85,13 @@ require (
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.100.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71 // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.29.1 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 5427b8f

Please sign in to comment.