-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/sonarqube #163
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
Merged
Merged
Feat/sonarqube #163
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
38c9474
Added Algorithm, which returns a sorted list of recipes of an matchin…
PrussianBaron ef43421
Added Filtering
PrussianBaron e701e83
Tests für Database, passwort überprüfung und email überürufung wurden…
Nicoolaus ef3fd46
ci pipeline abhägigkeit mit rein gemacht
Nicoolaus d2c72c0
Feat bei Ci yml entfernt
Nicoolaus 70b7d97
Delete project/data/LazyCookDB.sqlite3
GalacticCodeGambit 7b20faf
Feature: Forgot Password link in signin modal. Popup for Email Input.…
EdenBernhard 0885213
Feat/ci cd add lint (#142)
GalacticCodeGambit a0b9722
Merge remote-tracking branch 'origin/feat/test' into blatt15
GalacticCodeGambit 534fef4
Merge remote-tracking branch 'origin/blatt15' into blatt15
GalacticCodeGambit 05c6f83
update super-linter to version 8.6.0 in CI configuration
GalacticCodeGambit e821f76
Test Linter
GalacticCodeGambit 1930c91
Test Linter
GalacticCodeGambit 68dcdef
Feature: Email and Password change popup width changed
EdenBernhard 2225fab
Separate linter configuration into its own workflow file (#149)
GalacticCodeGambit 7f7f042
Update Node.js version in Dockerfile-frontend to 24.1.0
GalacticCodeGambit de9f3e4
Merge remote-tracking branch 'origin/blatt15' into RecipeAlgorithm
PrussianBaron 64be75d
Tested the recipe algorithim
PrussianBaron fb33247
Feature: Fix problem with refresh token and include show Password
EdenBernhard 48251d2
Feature: forgot password functionality works with redirection to home…
EdenBernhard c42c310
Merge branch 'feat/forgot-password-functionality'
EdenBernhard bee70b0
added SaveInDB Methods
PrussianBaron 38dbb2d
Potential fix for pull request finding
EdenBernhard b09dcbd
Potential fix for pull request finding
EdenBernhard 833b80e
Potential fix for pull request finding
EdenBernhard 9f34b74
Fix: Copilot review suggestion
EdenBernhard bb1a733
Fix: Copilot review suggestion
EdenBernhard 86d97a2
Fix: Copilot review suggestion
EdenBernhard a495626
Fix: Copilot review suggestion
EdenBernhard 0501cd8
Feat: forgot password functionality (#151)
EdenBernhard 9f2abc6
Merge remote-tracking branch 'origin/blatt17'
EdenBernhard e90f276
Feat: show top 5 incredients as options (#152)
EdenBernhard 8ec11cb
Merge remote-tracking branch 'origin/blatt17' into RecipeAlgorithm
PrussianBaron a47db44
Black used
PrussianBaron 0670d45
Merge pull request #153 to blatt17 from RecipeAlgorithm
PrussianBaron 4f6c21d
Merge remote-tracking branch 'origin/blatt17'
EdenBernhard 3c02e9f
Info: Standort von Impressum und Datenschutz
EdenBernhard a7ceb96
Added Review-Protokoll-01
GalacticCodeGambit 42e06bb
Clear participant roles in review protocol
GalacticCodeGambit e27f003
Update participants and review focus in documentation
GalacticCodeGambit 3792403
Made the required RecipeSUCUK changes
PrussianBaron 5db1e8d
Rename RecipeSucuk.py to RecipeSUCUK.py
PrussianBaron 74f6e20
Added Search Algorithm for Recipe Name search
PrussianBaron f6a85bc
Merge branch 'blatt17' of https://github.com/GalacticCodeGambit/LazyC…
PrussianBaron 4f25613
SearchRecipeNames now returns a list of recipe Objects
PrussianBaron 8961073
Add SonarCloud configuration and update requirements for coverage rep…
GalacticCodeGambit fa6277f
Test Commit
GalacticCodeGambit a686f9b
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 34d8b00
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard ad4f4cf
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 1caad88
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 4d2ee9a
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 641cf9c
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard bd34f2b
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard a749a1e
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 491a418
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 9237ab7
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 6b0310e
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard a88dbe4
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 34b75f7
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard c7647ce
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 0e2bc05
Apply suggestions from code review
GalacticCodeGambit 154afd3
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard e5c2832
Merge remote-tracking branch 'origin/feat/sonarqube' into feat/sonarqube
EdenBernhard 5b248c3
Merge branch 'main' into feat/sonarqube
EdenBernhard 36a4e6a
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard d2819b7
Merge remote-tracking branch 'origin/feat/sonarqube' into feat/sonarqube
EdenBernhard 521c7cd
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 27c7583
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 5d2f75c
Test: Sonarqube workflow with result print in CI-Pipeline
EdenBernhard 1eefcae
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 2de83d1
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard c07e869
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 6bb6a65
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 119f4ac
Revert "Apply suggestions from code review"
EdenBernhard f38c1c8
Revert "Test: Sonarqube workflow with result print in CI-Pipeline"
EdenBernhard 0a4051d
Revert "Revert "Apply suggestions from code review""
EdenBernhard 77bc4c4
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 847fb33
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 2993dc3
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard da348f0
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard ff40d5e
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 5d07259
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard da3856b
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard 5cc69db
Test: Bash Print in CI/CD - Pipeline with detailed information about …
EdenBernhard f7278d4
Fix: Code Preview from Copilot fixes
EdenBernhard 24359c2
Fix: Code Preview from Copilot fixes
EdenBernhard b3b683a
Fix: Code Preview from Copilot fixes
EdenBernhard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,333 @@ | ||
| name: SonarCloud Full Metrics (main branch) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| workflow_dispatch: | ||
|
EdenBernhard marked this conversation as resolved.
|
||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| full-metrics: | ||
| name: Full Project Report | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Python-Version aus Dockerfile lesen | ||
| id: pyver | ||
| run: | | ||
| VERSION=$(grep -oP '(?<=python:)\d+\.\d+' project/Dockerfile-backend | head -1) | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| # ===================================================== | ||
| # Backend-Tests + Coverage | ||
| # ===================================================== | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ steps.pyver.outputs.version }} | ||
|
|
||
|
Comment on lines
+31
to
+35
EdenBernhard marked this conversation as resolved.
Comment on lines
+31
to
+35
|
||
| - name: Install backend deps | ||
| working-directory: project/backend | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install "pytest-cov>=5,<7" "coverage>=7" | ||
|
EdenBernhard marked this conversation as resolved.
|
||
|
|
||
| - name: Run backend tests with coverage | ||
| working-directory: project | ||
| run: | | ||
| python -m pytest \ | ||
| --cov=backend \ | ||
| --cov-report=xml:backend/coverage.xml \ | ||
| --cov-report=term-missing \ | ||
| backend/tests/ | ||
| continue-on-error: true | ||
|
EdenBernhard marked this conversation as resolved.
EdenBernhard marked this conversation as resolved.
|
||
|
|
||
| # ===================================================== | ||
| # SonarCloud Scan | ||
| # ===================================================== | ||
| - name: SonarQube Scan | ||
| uses: SonarSource/sonarqube-scan-action@v3 | ||
| with: | ||
| projectBaseDir: project | ||
| args: > | ||
| -Dsonar.projectKey=GalacticCodeGambit_LazyCook | ||
| -Dsonar.organization=galacticcodegambit | ||
| -Dproject.settings=sonar-project.properties | ||
| -Dsonar.python.coverage.reportPaths=backend/coverage.xml | ||
| -Dsonar.python.version=${{ steps.pyver.outputs.version }} | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
|
||
| - name: Wait for analysis | ||
| id: qg | ||
| uses: SonarSource/sonarqube-quality-gate-action@v1.2.0 | ||
| timeout-minutes: 5 | ||
| with: | ||
|
EdenBernhard marked this conversation as resolved.
|
||
| scanMetadataReportFile: project/.scannerwork/report-task.txt | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
|
||
| # ===================================================== | ||
| # Voller Projekt-Report ins Job-Summary | ||
| # ===================================================== | ||
| - name: Render Full Metrics | ||
| if: always() | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| SONAR_HOST: https://sonarcloud.io | ||
| QG_STATUS: ${{ steps.qg.outputs.quality-gate-status }} | ||
| run: | | ||
| set +e | ||
| KEY="GalacticCodeGambit_LazyCook" | ||
| OUT="$GITHUB_STEP_SUMMARY" | ||
|
|
||
| # Alle relevanten Branch-Metriken auf einen Schwung holen | ||
| METRICS="alert_status,bugs,vulnerabilities,code_smells,security_hotspots,security_hotspots_reviewed,coverage,line_coverage,branch_coverage,lines_to_cover,uncovered_lines,duplicated_lines_density,duplicated_blocks,duplicated_files,duplicated_lines,complexity,cognitive_complexity,classes,functions,statements,files,ncloc,comment_lines,comment_lines_density,sqale_rating,reliability_rating,security_rating,security_review_rating,sqale_index,sqale_debt_ratio,reliability_remediation_effort,security_remediation_effort" | ||
|
|
||
| URL="${SONAR_HOST}/api/measures/component?component=${KEY}&metricKeys=${METRICS}" | ||
| RESP=$(curl -s -u "${SONAR_TOKEN}:" "${URL}") | ||
|
|
||
| # Mini-Diagnose im Log | ||
| echo "Anfrage: ${URL}" | ||
| echo "Response (erste 300 Zeichen):" | ||
| echo "${RESP}" | head -c 300 | ||
| echo "" | ||
|
|
||
| # Hilfsfunktion: Metrik-Wert holen, "-" als Fallback | ||
| get() { | ||
| echo "${RESP}" | jq -r --arg k "$1" \ | ||
| '(.component.measures[]? | select(.metric==$k) | .value) // "-"' 2>/dev/null | ||
| } | ||
|
|
||
| # Rating-Buchstabe (1.0..5.0 → A..E) | ||
| rating() { | ||
| case "$(get "$1")" in | ||
| 1.0) echo "A" ;; 2.0) echo "B" ;; 3.0) echo "C" ;; | ||
| 4.0) echo "D" ;; 5.0) echo "E" ;; *) echo "-" ;; | ||
| esac | ||
| } | ||
|
|
||
| # Minuten → Stunden + Minuten | ||
| fmt_debt() { | ||
| local m=$1 | ||
| if [[ "$m" =~ ^[0-9]+$ ]]; then | ||
| local h=$((m / 60)); local r=$((m % 60)) | ||
| echo "${h}h ${r}min" | ||
| else | ||
| echo "-" | ||
| fi | ||
| } | ||
|
|
||
| # Quality-Gate-Icon | ||
| if [ "${QG_STATUS}" = "PASSED" ] || [ "$(get alert_status)" = "OK" ]; then | ||
| QG_ICON=":white_check_mark:"; QG_TXT="PASSED" | ||
| else | ||
| QG_ICON=":x:"; QG_TXT="FAILED" | ||
| fi | ||
|
|
||
| DEBT_FMT=$(fmt_debt "$(get sqale_index)") | ||
| REL_EFF_FMT=$(fmt_debt "$(get reliability_remediation_effort)") | ||
| SEC_EFF_FMT=$(fmt_debt "$(get security_remediation_effort)") | ||
|
|
||
| # ===== Backend-Coverage direkt aus coverage.xml ===== | ||
| COV_FILE="project/backend/coverage.xml" | ||
| if [ -f "${COV_FILE}" ]; then | ||
| COV_DATA=$(python3 - "${COV_FILE}" <<'PYEOF' | ||
| import sys, xml.etree.ElementTree as ET | ||
| root = ET.parse(sys.argv[1]).getroot() | ||
| lr = float(root.get('line-rate', '0')) | ||
| br = float(root.get('branch-rate', '0')) | ||
| lv = int(root.get('lines-valid', '0')) | ||
| lc = int(root.get('lines-covered', '0')) | ||
| bv = int(root.get('branches-valid', '0')) | ||
| bc = int(root.get('branches-covered', '0')) | ||
| total = lv + bv | ||
| covered = lc + bc | ||
| overall = (covered / total * 100) if total > 0 else 0.0 | ||
| uncov_lines = lv - lc | ||
| uncov_branches = bv - bc | ||
| print(f"{overall:.1f} {lr*100:.1f} {br*100:.1f} {lv} {lc} {bv} {bc} {uncov_lines} {uncov_branches}") | ||
| PYEOF | ||
| ) | ||
| read -r COV_OVERALL COV_LINE COV_BRANCH LINES_VALID LINES_COVERED BRANCHES_VALID BRANCHES_COVERED UNCOVERED_LINES UNCOVERED_BRANCHES <<< "${COV_DATA}" | ||
| echo "Backend-Coverage aus coverage.xml: ${COV_OVERALL}% (Line ${COV_LINE}%, Branch ${COV_BRANCH}%)" | ||
| else | ||
| echo "::warning::coverage.xml nicht gefunden bei ${COV_FILE}" | ||
| COV_OVERALL="-"; COV_LINE="-"; COV_BRANCH="-" | ||
| LINES_VALID="-"; LINES_COVERED="-"; BRANCHES_VALID="-"; BRANCHES_COVERED="-" | ||
| UNCOVERED_LINES="-"; UNCOVERED_BRANCHES="-" | ||
| fi | ||
|
|
||
| # ===== Summary schreiben ===== | ||
| { | ||
| echo "# SonarCloud – Voller Projekt-Report" | ||
| echo "" | ||
| echo "**Quality Gate:** ${QG_ICON} **${QG_TXT}** " | ||
| echo "**Branch:** ${GITHUB_REF_NAME} " | ||
| echo "**Commit:** ${GITHUB_SHA:0:7} " | ||
| echo "**Dashboard:** [${SONAR_HOST}/project/overview?id=${KEY}](${SONAR_HOST}/project/overview?id=${KEY})" | ||
| echo "" | ||
|
|
||
| # --- Übersicht --- | ||
| echo "## Projekt-Übersicht" | ||
| echo "" | ||
| echo "| Kennzahl | Wert |" | ||
| echo "|---|---:|" | ||
| echo "| Lines of Code | $(get ncloc) |" | ||
| echo "| Kommentar-Zeilen | $(get comment_lines) |" | ||
| echo "| Kommentar-Anteil | $(get comment_lines_density)% |" | ||
| echo "| Dateien | $(get files) |" | ||
| echo "| Klassen | $(get classes) |" | ||
| echo "| Funktionen | $(get functions) |" | ||
| echo "| Statements | $(get statements) |" | ||
| echo "" | ||
|
|
||
| # --- Coverage (aus pytest-cov coverage.xml, nicht aus Sonar-API) --- | ||
| echo "## Test-Coverage (Backend / Python)" | ||
| echo "" | ||
| echo "_Werte direkt aus \`backend/coverage.xml\` von pytest-cov gelesen._" | ||
| echo "" | ||
| echo "| Metrik | Wert |" | ||
| echo "|---|---:|" | ||
| echo "| Coverage (gesamt) | ${COV_OVERALL}% |" | ||
| echo "| Line Coverage | ${COV_LINE}% |" | ||
| echo "| Branch Coverage | ${COV_BRANCH}% |" | ||
| echo "| Deckbare Zeilen | ${LINES_VALID} |" | ||
| echo "| Gedeckte Zeilen | ${LINES_COVERED} |" | ||
| echo "| Ungedeckte Zeilen | ${UNCOVERED_LINES} |" | ||
| echo "| Deckbare Branches | ${BRANCHES_VALID} |" | ||
| echo "| Gedeckte Branches | ${BRANCHES_COVERED} |" | ||
| echo "| Ungedeckte Branches | ${UNCOVERED_BRANCHES} |" | ||
| echo "" | ||
|
|
||
| # --- Duplikate --- | ||
| echo "## Duplikate" | ||
| echo "" | ||
| echo "| Metrik | Wert |" | ||
| echo "|---|---:|" | ||
| echo "| Duplizierte Zeilen (Rate) | $(get duplicated_lines_density)% |" | ||
| echo "| Duplizierte Zeilen (absolut) | $(get duplicated_lines) |" | ||
| echo "| Duplikat-Blöcke | $(get duplicated_blocks) |" | ||
| echo "| Betroffene Dateien | $(get duplicated_files) |" | ||
| echo "" | ||
|
|
||
| # --- Komplexität --- | ||
| echo "## Komplexität" | ||
| echo "" | ||
| echo "| Metrik | Wert |" | ||
| echo "|---|---:|" | ||
| echo "| Zyklomatische Komplexität | $(get complexity) |" | ||
| echo "| Cognitive Complexity | $(get cognitive_complexity) |" | ||
| echo "" | ||
|
|
||
| # --- Issues & Ratings --- | ||
| echo "## Issues & Bewertungen" | ||
| echo "" | ||
| echo "| Kategorie | Rating | Anzahl | Behebungs-Aufwand |" | ||
| echo "|---|:---:|---:|---:|" | ||
| echo "| Reliability (Bugs) | $(rating reliability_rating) | $(get bugs) | ${REL_EFF_FMT} |" | ||
| echo "| Security (Vulnerabilities) | $(rating security_rating) | $(get vulnerabilities) | ${SEC_EFF_FMT} |" | ||
| echo "| Maintainability (Code Smells) | $(rating sqale_rating) | $(get code_smells) | ${DEBT_FMT} |" | ||
| echo "| Security Hotspots | $(rating security_review_rating) | $(get security_hotspots) | $(get security_hotspots_reviewed)% reviewed |" | ||
| echo "" | ||
|
|
||
| # --- Technische Schuld --- | ||
| echo "## Technische Schuld" | ||
| echo "" | ||
| echo "| Metrik | Wert |" | ||
| echo "|---|---:|" | ||
| echo "| Gesamte Schuld | ${DEBT_FMT} |" | ||
| echo "| Debt Ratio | $(get sqale_debt_ratio)% |" | ||
| echo "" | ||
| } >> "$OUT" | ||
|
|
||
| # ===================================================== | ||
| # Top-10 Files: höchste Komplexität, schlechteste Coverage | ||
| # ===================================================== | ||
| { | ||
| echo "## Top-10 komplexeste Dateien" | ||
| echo "" | ||
| echo "| Datei | Komplexität | Cognitive | LoC |" | ||
| echo "|---|---:|---:|---:|" | ||
| } >> "$OUT" | ||
|
|
||
| curl -s -u "${SONAR_TOKEN}:" \ | ||
| "${SONAR_HOST}/api/measures/component_tree?component=${KEY}&metricKeys=complexity,cognitive_complexity,ncloc&qualifiers=FIL&ps=10&s=metric&metricSort=complexity&asc=false" \ | ||
| | jq -r '.components[]? | ||
| | (.path // .key) as $p | ||
| | ((.measures[]? | select(.metric=="complexity") | .value) // "-") as $c | ||
| | ((.measures[]? | select(.metric=="cognitive_complexity")| .value) // "-") as $cog | ||
| | ((.measures[]? | select(.metric=="ncloc") | .value) // "-") as $n | ||
| | "| " + $p + " | " + $c + " | " + $cog + " | " + $n + " |"' \ | ||
| >> "$OUT" | ||
|
|
||
| { | ||
| echo "" | ||
| echo "## Coverage-Übersicht aller Backend-Dateien" | ||
| echo "" | ||
| echo "_Aus \`backend/coverage.xml\`, sortiert aufsteigend nach Coverage (schlechteste zuerst)._" | ||
| echo "" | ||
| echo "| Datei | Coverage | Gedeckte / Deckbare | Ungedeckte Zeilen |" | ||
| echo "|---|---:|---:|---:|" | ||
| } >> "$OUT" | ||
|
|
||
| if [ -f "${COV_FILE}" ]; then | ||
| python3 - "${COV_FILE}" >> "$OUT" <<'PYEOF' | ||
| import sys, xml.etree.ElementTree as ET | ||
| root = ET.parse(sys.argv[1]).getroot() | ||
| rows = [] | ||
| for cls in root.iter('class'): | ||
| fname = cls.get('filename', '') | ||
| lines = cls.find('lines') | ||
| if lines is None: | ||
| continue | ||
| total = len(lines.findall('line')) | ||
| if total == 0: | ||
| continue | ||
| covered = sum(1 for l in lines.findall('line') if int(l.get('hits', '0')) > 0) | ||
| uncov = total - covered | ||
| pct = covered / total * 100 | ||
| rows.append((pct, fname, covered, total, uncov)) | ||
| # Aufsteigend nach Coverage, bei Gleichstand größere Dateien zuerst | ||
| rows.sort(key=lambda r: (r[0], -r[3])) | ||
| for pct, fname, cov, total, uncov in rows: | ||
| print(f"| {fname} | {pct:.1f}% | {cov} / {total} | {uncov} |") | ||
| print() | ||
| print(f"_Insgesamt {len(rows)} Datei(en) mit Coverage-Daten._") | ||
| PYEOF | ||
| else | ||
| echo "_coverage.xml nicht gefunden._" >> "$OUT" | ||
| fi | ||
|
|
||
| { | ||
| echo "" | ||
| echo "## Top-10 Dateien mit den meisten Duplikat-Blöcken" | ||
| echo "" | ||
| echo "| Datei | Blöcke | Dupl. Zeilen | LoC |" | ||
| echo "|---|---:|---:|---:|" | ||
| } >> "$OUT" | ||
|
|
||
| curl -s -u "${SONAR_TOKEN}:" \ | ||
| "${SONAR_HOST}/api/measures/component_tree?component=${KEY}&metricKeys=duplicated_blocks,duplicated_lines,ncloc&qualifiers=FIL&ps=10&s=metric&metricSort=duplicated_blocks&asc=false" \ | ||
| | jq -r '.components[]? | ||
| | (.path // .key) as $p | ||
| | ((.measures[]? | select(.metric=="duplicated_blocks") | .value) // "0") as $b | ||
| | ((.measures[]? | select(.metric=="duplicated_lines") | .value) // "0") as $l | ||
| | ((.measures[]? | select(.metric=="ncloc") | .value) // "-") as $n | ||
| | select(($b | tonumber) > 0) | ||
| | "| " + $p + " | " + $b + " | " + $l + " | " + $n + " |"' \ | ||
| >> "$OUT" | ||
|
|
||
| { | ||
| echo "" | ||
| echo "---" | ||
| echo "_Generiert von SonarCloud-Analyse aus Push auf \`${GITHUB_REF_NAME}\`._" | ||
| } >> "$OUT" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.