Skip to content

Minor refactor & comments - #2

Merged
bnkamalesh merged 4 commits into
mainfrom
refactor
Aug 8, 2025
Merged

Minor refactor & comments#2
bnkamalesh merged 4 commits into
mainfrom
refactor

Conversation

@bnkamalesh

Copy link
Copy Markdown
Member

[patch] minor refactor to reduce cognitive complexity of function
[-] added comments to relevant sections for clarity on configurations

@bnkamalesh
bnkamalesh requested a review from Copilot August 8, 2025 11:25
@bnkamalesh bnkamalesh self-assigned this Aug 8, 2025
@bnkamalesh bnkamalesh added the documentation Improvements or additions to documentation label Aug 8, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR performs a minor refactoring to reduce cognitive complexity in the main listening logic and adds detailed documentation comments to configuration fields. The refactor extracts the core listening logic into a separate method while improving error handling flow.

  • Extracted the main select statement logic from Listen() into a new listener() method to reduce cognitive complexity
  • Enhanced documentation comments for all Config struct fields with default value information and usage guidelines
  • Minor cleanup including removal of unused variable and type inference improvement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
nibbler.go Refactored Listen() method by extracting core logic to listener(), enhanced Config field documentation, and removed unused variable
README.md Updated Config documentation to match the enhanced comments in the code

Comment thread README.md Outdated
Comment thread nibbler.go Outdated
@bnkamalesh
bnkamalesh merged commit 6639cbb into main Aug 8, 2025
1 check passed
@bnkamalesh
bnkamalesh deleted the refactor branch August 8, 2025 11:28
@bnkamalesh
bnkamalesh restored the refactor branch August 8, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants