Skip to content

fix: rename max var shadowing builtin - #975

Merged
skevetter merged 1 commit into
mainfrom
fix/codefactor/lang-max-redef
Aug 10, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/codefactor/lang-max-redef

Conversation

@devsy-app

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

Copy link
Copy Markdown
Contributor

Codefactor issue fix

  • Codefactor issue: Redefinition of built-in function max (Maintainability) — pkg/language/language.go, lines 221 & 225
  • File:line: pkg/language/language.go:221 (function detectLanguageByExtension)

Problem

Codefactor flagged the local variable max declared in detectLanguageByExtension as a redefinition of the built-in max function, shadowing the builtin and reducing maintainability/clarity.

Fix

Renamed the local variable max → maxCount (and its two references in the comparison loop). This removes the builtin shadowing without changing any behavior — the loop still tracks the programming language with the highest file count, using the same tie-break on lexicographic ordering.

Single-file, ~4-line change, no API or behavioral impact.

Verification

  • task cli:lint:ci — 0 new issues (clean)
  • task cli:format — passed (no formatting changes needed)
  • go build ./pkg/language/... + go vet ./pkg/language/... — OK
  • task cli:test — pkg/language has no test files; the only failing package is pkg/git (TestRepoClone*), a known pre-existing failure on origin/main unrelated to this change (this PR touches pkg/language, not pkg/git).

Commit authenticated as the Devsy GitHub App (verified=true, SHA 93726e7).

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

Codefactor flagged the local variable 'max' in detectLanguageByExtension as a redefinition of the built-in function (pkg/language/language.go). Rename it to maxCount so the loop tracks the highest file count without shadowing the builtin max.
@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 93726e7
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a7918947f2ccc0008200d89

@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 93726e7
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a791894e6fac4000864966f

@skevetter
skevetter marked this pull request as ready for review August 10, 2026 00:21
@skevetter
skevetter enabled auto-merge (squash) August 10, 2026 00:21
@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 merged commit 008960c into main Aug 10, 2026
67 checks passed
@skevetter
skevetter deleted the fix/codefactor/lang-max-redef branch August 10, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant