Skip to content

Commit 81c0799

Browse files
authored
periphery (#126)
# periphery ## ♻️ Current situation & Problem adresses all periphery findings. some unused things are removed, and the rest are explicitly ignored and marked as "API", meaning that even though they're currently unused, they should be kept around bc they are considered as being an integral part of the parent entity's functionality. ## ⚙️ Release Notes - internal changes ## 📚 Documentation n/a ## ✅ Testing n/a ### Code of Conduct & Contributing Guidelines By creating and submitting this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
1 parent 9446ba3 commit 81c0799

53 files changed

Lines changed: 66 additions & 94 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MyHeartCounts/Account/AccountSheet.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ struct AccountSheet: View {
6565
}
6666
}
6767

68-
@ToolbarContentBuilder private var closeButton: some ToolbarContent {
69-
ToolbarItem(placement: .cancellationAction) {
70-
Button("Close") {
71-
dismiss()
72-
}
73-
}
74-
}
75-
7668
@ViewBuilder private var accountSheetExtraContent: some View {
7769
Section {
7870
SensorKitButton()

MyHeartCounts/Account/Demographics/Comorbidities.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ extension Comorbidities {
8787
self.subtitle = subtitle
8888
}
8989

90+
// periphery:ignore - API
9091
init?(id: String) {
9192
if let value = (Self.primaryComorbidities + Self.secondaryComorbidities).first(where: { $0.id == id }) {
9293
self = value

MyHeartCounts/Account/Demographics/DemographicsAccountKeys.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ extension AccountKeyCategory {
1818

1919

2020
extension AccountDetails {
21-
typealias UKCounty = UKRegion.County
22-
23-
2421
@AccountKey(
2522
id: "mhcGenderIdentity",
2623
name: "Gender Identity",

MyHeartCounts/Account/Demographics/DemographicsLayout.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ private enum DemographicsLayoutBuilder {
429429
_ConditionalComponent(storage: .false(component))
430430
}
431431

432+
// periphery:ignore - implicity called
432433
static func buildBlock() -> some DemographicsComponent {
433434
_EmptyComponent()
434435
}

MyHeartCounts/Account/Demographics/StageOfChange.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Foundation
1111

1212
struct StageOfChangeOption: Hashable, Identifiable, Sendable {
1313
let id: String
14+
// periphery:ignore - API
1415
let title: LocalizedStringResource?
1516
let text: LocalizedStringResource
1617
}

MyHeartCounts/Account/Demographics/UKRegion.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ extension UKRegion {
110110

111111

112112
extension UKRegion.County {
113+
// periphery:ignore - ???
113114
static let preferNotToSay = Self(name: "Prefer not to state")
114115

115116
static let englishCounties: [Self] = [

MyHeartCounts/Heart Health Dashboard/Components/ScoreResultGauge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct ScoreResultGauge: View {
1515

1616
var body: some View {
1717
Gauge(
18-
lineWidth: .relative(1.5),
18+
lineWidth: lineWidth,
1919
gradient: scoreResult.scoreAvailable ? .redToGreen : Gradient(colors: [.secondary]),
2020
progress: scoreResult.score
2121
) {

MyHeartCounts/Heart Health Dashboard/DetailedHealthStatsView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct DetailedHealthStatsView: View {
2929
case enabled(timeRange: HealthKitQueryTimeRange)
3030
}
3131

32-
@Environment(\.calendar) private var cal
3332
@Environment(StudyManager.self) private var studyManager
3433
@State private var chartTimeRange: ChartTimeRange = .lastNumDays(14)
3534

MyHeartCounts/Heart Health Dashboard/HeartHealthDashboard.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ struct HeartHealthDashboard: View {
198198
}
199199
}
200200

201+
// periphery:ignore - API
201202
private func addNewSample(for keyPath: KeyPath<CVHScore, ScoreResult>) {
202203
if Self.canAddSample(for: keyPath) {
203204
addNewSampleDescriptor = .init(keyPath: keyPath)

MyHeartCounts/Heart Health Dashboard/QuantitySample.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ struct QuantitySample: Hashable, Identifiable, Sendable {
221221
precondition(endDate >= startDate)
222222
}
223223

224+
// periphery:ignore - API
224225
func value(as unit: HKUnit) -> Double {
225226
self.unit == unit ? value : HKQuantity(unit: self.unit, doubleValue: value).doubleValue(for: unit)
226227
}

0 commit comments

Comments
 (0)