Skip to content

Conversation

@ssathy2
Copy link
Owner

@ssathy2 ssathy2 commented Nov 7, 2025

Resolves compiler error on line 77 by breaking up complex expressions into distinct sub-expressions:

  • Extract sorted error types into computed property
  • Break down chart height calculation into named constants

Resolves compiler error on line 77 by breaking up complex expressions
into distinct sub-expressions:
- Extract sorted error types into computed property
- Break down chart height calculation into named constants
@ssathy2 ssathy2 requested a review from Copilot November 7, 2025 22:30
Copy link

Copilot AI left a comment

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 refactors the ErrorSummarySection view by extracting inline computations into computed properties for better code organization and readability.

  • Extracted sorted error types array into a sortedErrorTypes computed property
  • Extracted chart height calculation into a chartHeight computed property with named constants

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 79
private var sortedErrorTypes: [String] {
Array(errorsByType.keys).sorted()
}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The sortedErrorTypes computed property will be recalculated every time SwiftUI accesses it during view updates. Since errorsByType is immutable after initialization, consider caching this value. You can either use a stored property initialized in init, or use a lazy var if the property is only accessed conditionally.

Copilot uses AI. Check for mistakes.
- Extract helper methods for error count and truncated error type
- Split body into smaller computed properties (titleView, errorChart)
- Use local let bindings in ForEach to simplify BarMark expressions
- Add more intermediate variables in computed properties
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