Skip to content

fix: drop else after return in platform Login - #968

Merged
skevetter merged 1 commit into
mainfrom
fix/codefactor/platform-client-drop-else
Aug 9, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/codefactor/platform-client-drop-else

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codefactor issue fix

Codefactor issue key: 6a77b13d5b1ec0b4ee20c43e
File: pkg/platform/client/client.go:293
Category: Maintainability
Codefactor message: "If block ends with a return statement, so drop this else and outdent its block."

Problem

In client.Login, the browser-open result is handled with an
if err != nil { return ... } else { ... } block. The if branch always returns,
so the else is redundant and forces the success path to nest one level deeper
than necessary. Codefactor flags this as a maintainability issue.

Change

Removed the else and outdented its body so the success path runs at the
function's top indentation level. No behavior change — the success path only
runs when err == nil, identical to before.

// before
if err != nil {
    return fmt.Errorf(...)
} else {
    log.Infof(...)
    ...
    key = <-keyChannel
}

// after
if err != nil {
    return fmt.Errorf(...)
}
log.Infof(...)
...
key = <-keyChannel

Verification

  • task cli:format — clean
  • task cli:lint:ci — 0 new issues
  • task cli:test — passes except the known pre-existing pkg/git
    TestRepoClone* failures on origin/main (documented in AGENTS.md; this
    change does not touch pkg/git)

This PR was created by an AI agent as part of an automated daily Codefactor
issue fix job.

Drop redundant else after early return in Login to
satisfy the Codefactor Maintainability check. The browser-open
success path no longer nests under an else, so it runs on the
function's top indentation level.

Codefactor issue: 6a77b13d5b1ec0b4ee20c43e
File: pkg/platform/client/client.go:293
@netlify

netlify Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 3a163f1
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a78f0d8c571e700086335d8

@netlify

netlify Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 3a163f1
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a78f0d8b33bb30008b150b2

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter marked this pull request as ready for review August 9, 2026 21:31
@skevetter
skevetter enabled auto-merge (squash) August 9, 2026 21:31
@skevetter
skevetter merged commit a2fdfb4 into main Aug 9, 2026
67 checks passed
@skevetter
skevetter deleted the fix/codefactor/platform-client-drop-else branch August 9, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant