Skip to content

fix: resolve all SonarQube findings on PR #81#83

Merged
ThePlenkov merged 2 commits intocopilot/support-programs-functional-groupsfrom
copilot/fix-sonarqube-findings
Mar 14, 2026
Merged

fix: resolve all SonarQube findings on PR #81#83
ThePlenkov merged 2 commits intocopilot/support-programs-functional-groupsfrom
copilot/fix-sonarqube-findings

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Addresses all 14 SonarQube findings raised against the PROG/FUGR support branch, plus PR review comments.

config-loader.ts — Cognitive complexity 32→~10 (S3776)

  • Extracted discoverConfig(basePath, baseName) to deduplicate the repeated .ts → .js → .json fallback chain
  • Extracted loadExplicitConfig(configPath) for the --config path handling
  • Removed useless || {} spreads in mergeLocalConfig (S7744 ×2)

build-utils.ts — Cognitive complexity reduction (S3776 ×2) + for-of (S4138 ×3)

  • Lifted nested walk() closure into standalone collectUsedPrefixes(node, set) — eliminates nesting penalty for both the helper and stripUnusedNamespaces
  • Converted three indexed for loops over NamedNodeMap/NodeList to for-of via Array.from()

cli.ts — Import hygiene (S7772, S3863, S7753)

  • Consolidated duplicate fs/path imports into single node:fs / node:path imports
  • .findIndex(arg => arg === '--config').indexOf('--config')

prog.ts — Nested ternary (S3358)

// Before
const descriptionEntry = Array.isArray(TPOOL?.item)
  ? TPOOL.item.find(...)
  : TPOOL?.item?.ID === 'R' ? TPOOL.item : undefined;

// After
let descriptionEntry;
if (Array.isArray(TPOOL?.item)) {
  descriptionEntry = TPOOL.item.find(...);
} else if (TPOOL?.item?.ID === 'R') {
  descriptionEntry = TPOOL.item;
}

PR review threads

  • Null guard on candidate.options — already present on line 72 (candidate.options != null &&), no change needed
  • PR scope comment — informational, acknowledged

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/2c3c42a9-93b0-43f3-b12c-fa16ff256d79-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx test adt-plugin-abapgit -c "tsdown" bash h --noprofile -c ripts/log-tool-c--noprofile sh -c "tsdown" jq in/node person.xsd /homenode ts de/node/bin/bashrun s-morph.test.ts --reporter=default (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/2ee66b52-a23b-4d53-a288-e36254fb0c43-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build ts-xsd conf�� --local user.name alls.sh (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/5385b396-12be-4859-b568-c2fc8c81c2ab
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx test adt-config i/no�� "tsdown" .github/hooks/scadt-cli i/node_modules/.bin/sh abapgit (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/5385b396-12be-4859-b568-c2fc8c81c2ab-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx test adt-config i/no�� "tsdown" .github/hooks/scadt-cli i/node_modules/.bin/sh abapgit (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/59088ecc-2ae1-47b7-bd97-cf08f83fb74d
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build adt-cli -1 REDACTED (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/7c674b3d-a165-4c1e-83c2-f7db85837027
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build adt-cli -1 REDACTED (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/8663bac6-ad38-439d-aa40-83a991680959-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build adt-config --no�� --noprofile -c rkflows.sh (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/95e1bbf3-a5dd-49df-a220-f8d103e20e2d-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx test ts-xsd --no�� --noprofile -c odules/.bin/sh ot%2Ffix-sonarqups --local bin/sh sh bin/�� "tsdown" git /home/REDACTED/work/_temp/ghcca-node/node/bin/node origin copilot/support--c alls.sh node (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/dc43a944-4329-4c41-b786-faa466895f2b-logs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build ts-xsd adt-config adt-cli adt-plugin-abapgit /home/REDACTED/work/_temp/ghcca-node/node/bin/git credential.helpesh (http block)
  • https://storage.googleapis.com/prod-north-america/69ab0980542defed8d2aa8f4/e1f9a469-3427-407a-8e56-578c7bb9a659
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/adt-cli/adt-cli/node_modules/.bin/nx build adt-cli -1 REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Mar 14, 2026

View your CI Pipeline Execution ↗ for commit 6f4ddaa

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 38s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-14 22:11:08 UTC

- Extract nested ternary in prog.ts (S3358)
- Convert for loops to for-of in build-utils.ts (S4138 x3)
- Extract walk helper to reduce cognitive complexity in build-utils.ts (S3776 x2)
- Consolidate fs imports to node:fs in cli.ts (S7772, S3863)
- Replace findIndex with indexOf in cli.ts (S7753)
- Remove useless empty objects in config-loader.ts (S7744 x2)
- Extract helpers to reduce loadConfig cognitive complexity (S3776)

Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
@sonarqubecloud
Copy link

Copilot AI changed the title [WIP] Fix all SonarQube findings and address comments fix: resolve all SonarQube findings on PR #81 Mar 14, 2026
Copilot AI requested a review from ThePlenkov March 14, 2026 21:28
@ThePlenkov ThePlenkov marked this pull request as ready for review March 14, 2026 22:10
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 137e2092-a807-4975-8740-c44d9c9f47fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-sonarqube-findings
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@ThePlenkov ThePlenkov merged commit b8513ec into copilot/support-programs-functional-groups Mar 14, 2026
4 checks passed
@ThePlenkov ThePlenkov deleted the copilot/fix-sonarqube-findings branch March 14, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants