Skip to content

fix: Duplicated string literals#166

Open
mrwind-up-bird wants to merge 2 commits intoSimplyLiz:developfrom
mrwind-up-bird:autofix/b3cf0967/duplicated-string-literals
Open

fix: Duplicated string literals#166
mrwind-up-bird wants to merge 2 commits intoSimplyLiz:developfrom
mrwind-up-bird:autofix/b3cf0967/duplicated-string-literals

Conversation

@mrwind-up-bird
Copy link
Collaborator

AutoFix: Duplicated string literals

Category: code-smell
Severity: low

Issue

Multiple files contain duplicated string literals like "human" and "json" for format parameters, which could lead to inconsistencies if changed in the future.

Fix

Introduced named constants for format parameter values (FormatHuman and FormatJSON) to eliminate duplicated string literals. This improves maintainability by centralizing these values and prevents inconsistencies if the format options need to change in the future.


Generated by nyxCore AutoFix

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 58.24561% with 833 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/suggest/analyzer.go 53.6% 142 Missing and 12 partials ⚠️
internal/testgap/analyzer.go 12.3% 140 Missing and 2 partials ⚠️
internal/query/compound_refactor.go 37.1% 105 Missing and 15 partials ⚠️
internal/query/prepare_rename.go 0.0% 70 Missing ⚠️
internal/mcp/server.go 19.1% 51 Missing and 4 partials ⚠️
internal/mcp/tool_impls_compound.go 46.3% 41 Missing and 10 partials ⚠️
internal/query/prepare_move.go 63.1% 32 Missing and 6 partials ⚠️
internal/audit/analyzer.go 21.0% 30 Missing ⚠️
internal/query/compound.go 25.0% 24 Missing and 3 partials ⚠️
internal/mcp/tool_impls_testgap.go 0.0% 25 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #166     +/-   ##
=========================================
+ Coverage     45.1%   49.9%   +4.8%     
=========================================
  Files          350     305     -45     
  Lines        59747   53313   -6434     
=========================================
- Hits         26961   26628    -333     
+ Misses       30960   24797   -6163     
- Partials      1826    1888     +62     
Flag Coverage Δ
unit 49.9% <58.2%> (+4.8%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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