[GH-ISSUE #1635] [Request] Reduce Gocyclo #62948

Closed
opened 2026-05-03 10:56:53 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @H0llyW00dzZ on GitHub (Dec 20, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1635

image

not good for AI when it's too complex

Originally created by @H0llyW00dzZ on GitHub (Dec 20, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1635 ![image](https://github.com/jmorganca/ollama/assets/17626300/21d4c771-a637-47e0-99ee-7d86f3ffcbc4) not good for AI when it's too complex
Author
Owner

@jmorganca commented on GitHub (May 6, 2024):

Hi there! Thanks for the issue! Would it be possible to highlight specific errors/issues in the code that could be improved? That would really help! Also would love any PRs that keep functionality as-is but make it more simple :). Thank you for pointing out the complex ones (and that's a neat tool..)

<!-- gh-comment-id:2097094964 --> @jmorganca commented on GitHub (May 6, 2024): Hi there! Thanks for the issue! Would it be possible to highlight specific errors/issues in the code that could be improved? That would really help! Also would love any PRs that keep functionality as-is but make it more simple :). Thank you for pointing out the complex ones (and that's a neat tool..)
Author
Owner

@H0llyW00dzZ commented on GitHub (May 7, 2024):

@jmorganca use this tool to detect which functions have high cyclomatic complexity:
https://github.com/fzipp/gocyclo

Also, note that writing code with high cyclomatic complexity (e.g., many if-else statements) makes it harder to write tests, even for functionality. It's better to write many if-else statements in tests instead of production code.

<!-- gh-comment-id:2097680819 --> @H0llyW00dzZ commented on GitHub (May 7, 2024): @jmorganca use this tool to detect which functions have high cyclomatic complexity: https://github.com/fzipp/gocyclo Also, note that writing code with high cyclomatic complexity (e.g., many if-else statements) makes it harder to write tests, even for functionality. It's better to write many if-else statements in tests instead of production code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#62948