Skip to content

Commit d151f59

Browse files
Fixed sonar issues (#60)
1 parent 331f868 commit d151f59

37 files changed

+304
-36
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Composer/FilePickerView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public struct FilePickerView: UIViewControllerRepresentable {
1515
return picker
1616
}
1717

18-
public func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {}
18+
public func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {
19+
// We don't need handling updates of the VC at the moment.
20+
}
1921

2022
public func makeCoordinator() -> FilePickerView.Coordinator {
2123
FilePickerView.Coordinator(fileURLs: $fileURLs)

Sources/StreamChatSwiftUI/ChatChannel/Composer/ImagePickerView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ struct ImagePickerView: UIViewControllerRepresentable {
2727
func updateUIViewController(
2828
_ uiViewController: UIImagePickerController,
2929
context: Context
30-
) {}
30+
) {
31+
// We don't need handling updates of the VC at the moment.
32+
}
3133

3234
func makeCoordinator() -> ImagePickerCoordinator {
3335
Coordinator(self)

Sources/StreamChatSwiftUI/ChatChannel/Composer/Suggestions/CommandsConfig.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public protocol CommandsConfig {
2525
/// Default commands configuration.
2626
public class DefaultCommandsConfig: CommandsConfig {
2727

28-
public init() {}
28+
public init() {
29+
// Public init.
30+
}
2931

3032
public let mentionsSymbol: String = "@"
3133
public let instantCommandsSymbol: String = "/"

Sources/StreamChatSwiftUI/ChatChannel/Composer/Suggestions/InstantCommands/GiphyCommandHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public struct GiphyCommandHandler: CommandHandler {
6060
selectedRangeLocation: Binding<Int>,
6161
command: Binding<ComposerCommand?>,
6262
extraData: [String: Any]
63-
) {}
63+
) {
64+
// Handled with attachment actions.
65+
}
6466

6567
public func commandHandler(for command: ComposerCommand) -> CommandHandler? {
6668
nil

Sources/StreamChatSwiftUI/ChatChannel/Gallery/ShareButtonView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ struct ShareActivityView: UIViewControllerRepresentable {
4949
func updateUIViewController(
5050
_ uiViewController: UIActivityViewController,
5151
context: UIViewControllerRepresentableContext<ShareActivityView>
52-
) {}
52+
) {
53+
// We don't need handling updates of the VC at the moment.
54+
}
5355
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/ImageAttachmentView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ struct LazyLoadingImage: View {
303303
var shouldSetFrame: Bool = true
304304
var imageTapped: ((Int) -> Void)? = nil
305305
var index: Int?
306-
var onImageLoaded: (UIImage) -> Void = { _ in }
306+
var onImageLoaded: (UIImage) -> Void = { _ in
307+
// Default implementation.
308+
}
307309

308310
var body: some View {
309311
ZStack {

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageTypeResolver.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,7 @@ extension MessageTypeResolving {
7676

7777
/// Default class implementation of the `MessageTypeResolving` protocol.
7878
public class MessageTypeResolver: MessageTypeResolving {
79-
public init() {}
79+
public init() {
80+
// Public init.
81+
}
8082
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/WebView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ struct WebView: UIViewRepresentable {
3030
return webView
3131
}
3232

33-
func updateUIView(_ webView: WKWebView, context: Context) {}
33+
func updateUIView(_ webView: WKWebView, context: Context) {
34+
// We don't need handling updates of the view at the moment.
35+
}
3436

3537
class Coordinator: NSObject, WKNavigationDelegate {
3638
var parent: WebView

Sources/StreamChatSwiftUI/ChatChannel/Reactions/MessageActions/DefaultMessageActions.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ extension MessageAction {
313313
id: MessageActionId.threadReply,
314314
title: L10n.Message.Actions.threadReply,
315315
iconName: "icn_thread_reply",
316-
action: {},
316+
action: {
317+
// No action performed, only navigation.
318+
},
317319
confirmationPopup: nil,
318320
isDestructive: false
319321
)

Sources/StreamChatSwiftUI/ChatChannel/Reactions/MessageActions/MessageActionsResolver.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public protocol MessageActionsResolving {
2121
/// Default implementation of the `MessageActionsResolving` protocol.
2222
public class MessageActionsResolver: MessageActionsResolving {
2323

24-
public init() {}
24+
public init() {
25+
// Public init.
26+
}
2527

2628
public func resolveMessageAction(
2729
info: MessageActionInfo,

0 commit comments

Comments
 (0)