Skip to content

Commit

Permalink
superflous cyclomatic_complexity disable removed
Browse files Browse the repository at this point in the history
  • Loading branch information
federicocappelli committed Jul 9, 2024
1 parent ae9ae18 commit c78c9a2
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ public extension BookmarkEntity {
makeWithModifiedAtConstraints(with: treeNode, rootFolder: rootFolder, favoritesFolders: favoritesFolders, in: context)
}

// swiftlint:disable:next cyclomatic_complexity
@discardableResult static func makeWithModifiedAtConstraints(with treeNode: BookmarkTreeNode, rootFolder: BookmarkEntity, favoritesFolders: [BookmarkEntity], in context: NSManagedObjectContext) -> BookmarkEntity {
var entity: BookmarkEntity!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public class AutofillUserScript: NSObject, UserScript, UserScriptMessageEncrypti
return jsonString
}()

// swiftlint:disable:next cyclomatic_complexity
public func messageHandlerFor(_ messageName: String) -> MessageHandler? {
guard let message = MessageName(rawValue: messageName) else {
os_log("Failed to parse Autofill User Script message: '%{public}s'", log: .userScripts, type: .debug, messageName)
Expand Down
1 change: 0 additions & 1 deletion Sources/DDGSync/internal/SyncOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ final class SyncOperation: Operation, @unchecked Sendable {
try await sync(fetchOnly: fetchOnly, dataProviders: dataProviders)
}

// swiftlint:disable:next cyclomatic_complexity
func sync(fetchOnly: Bool, dataProviders: [DataProviding] = []) async throws {
os_log(.debug, log: log, "Sync Operation Started. Fetch-only: %{public}s", String(fetchOnly))
defer {
Expand Down
1 change: 0 additions & 1 deletion Sources/Navigation/NavigationState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public enum NavigationState: Equatable, Comparable {
isFinished || isFailed
}

// swiftlint:disable:next cyclomatic_complexity
public static func == (lhs: NavigationState, rhs: NavigationState) -> Bool {
switch lhs {
case .expected(let navigationType): if case .expected(navigationType) = rhs { return true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public enum ExtensionMessage: RawRepresentable {
case simulateConnectionInterruption
case getDataVolume

// swiftlint:disable:next cyclomatic_complexity
public init?(rawValue data: Data) {
let name = data.first.flatMap(Name.init(rawValue:))
switch name {
Expand Down
1 change: 0 additions & 1 deletion Sources/NetworkProtection/Networking/Pinger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ public extension Pinger {
case decrypt_failed = 3 // decrypt failed
}

// swiftlint:disable:next cyclomatic_complexity
public init?(type: u_char, code: u_char) {
switch type {
case 0:
Expand Down
2 changes: 0 additions & 2 deletions Sources/NetworkProtection/PacketTunnelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {

// MARK: - App Messages

// swiftlint:disable:next cyclomatic_complexity
@MainActor public override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) {

guard let message = ExtensionMessage(rawValue: messageData) else {
Expand Down Expand Up @@ -1037,7 +1036,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
settings.apply(change: change)
}

// swiftlint:disable:next cyclomatic_complexity
private func handleSettingsChange(_ change: VPNSettings.Change, completionHandler: ((Data?) -> Void)? = nil) {
switch change {
case .setExcludeLocalNetworks:
Expand Down
2 changes: 0 additions & 2 deletions Sources/NetworkProtection/Settings/VPNSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public final class VPNSettings {

// MARK: - Applying Changes

// swiftlint:disable cyclomatic_complexity
public func apply(change: Change) {
switch change {
case .setConnectOnLogin(let connectOnLogin):
Expand Down Expand Up @@ -238,7 +237,6 @@ public final class VPNSettings {
self.disableRekeying = disableRekeying
}
}
// swiftlint:enable cyclomatic_complexity

// MARK: - Connect on Login

Expand Down
1 change: 0 additions & 1 deletion Sources/PixelKit/PixelKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ public final class PixelKit {
logger.debug("👾 PixelKit initialised: dryRun: \(self.dryRun, privacy: .public) appVersion: \(self.appVersion, privacy: .public) source: \(self.source ?? "-", privacy: .public) defaultHeaders: \(self.defaultHeaders, privacy: .public) pixelCalendar: \(self.pixelCalendar, privacy: .public)")
}

// swiftlint:disable:next cyclomatic_complexity
private func fire(pixelNamed pixelName: String,
frequency: Frequency,
withHeaders headers: [String: String]?,
Expand Down
1 change: 0 additions & 1 deletion Sources/PrivacyDashboard/PrivacyDashboardUserScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript {

weak var delegate: PrivacyDashboardUserScriptDelegate?

// swiftlint:disable:next cyclomatic_complexity
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
guard let messageType = MessageNames(rawValue: message.name) else {
assertionFailure("PrivacyDashboardUserScript: unexpected message name \(message.name)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import Common
import Foundation

// swiftlint:disable cyclomatic_complexity
private enum AttributesKey: String, CaseIterable {
case locale
case osApi
Expand Down Expand Up @@ -73,7 +72,6 @@ private enum AttributesKey: String, CaseIterable {
}
}
}
// swiftlint:enable cyclomatic_complexity

struct JsonToRemoteMessageModelMapper {

Expand All @@ -99,7 +97,6 @@ struct JsonToRemoteMessageModelMapper {
return remoteMessages
}

// swiftlint:disable:next cyclomatic_complexity
static func mapToContent(content: RemoteMessageResponse.JsonContent,
surveyActionMapper: RemoteMessagingSurveyActionMapping) -> RemoteMessageModelType? {
switch RemoteMessageResponse.JsonMessageType(rawValue: content.messageType) {
Expand Down
2 changes: 0 additions & 2 deletions Sources/RemoteMessaging/Matchers/AppAttributeMatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public struct AppAttributeMatcher: AttributeMatching {
self.variantManager = variantManager
}

// swiftlint:disable cyclomatic_complexity
public func evaluate(matchingAttribute: MatchingAttribute) -> EvaluationResult? {
switch matchingAttribute {
case let matchingAttribute as IsInternalUserMatchingAttribute:
Expand Down Expand Up @@ -95,5 +94,4 @@ public struct AppAttributeMatcher: AttributeMatching {
return nil
}
}
// swiftlint:enable cyclomatic_complexity
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public final class DefaultAppStorePurchaseFlow: AppStorePurchaseFlow {
self.authEndpointService = authEndpointService
}

// swiftlint:disable cyclomatic_complexity
public func purchaseSubscription(with subscriptionIdentifier: String, emailAccessToken: String?) async -> Result<TransactionJWS, AppStorePurchaseFlowError> {
os_log(.info, log: .subscription, "[AppStorePurchaseFlow] purchaseSubscription")
let externalID: String
Expand Down Expand Up @@ -116,7 +115,6 @@ public final class DefaultAppStorePurchaseFlow: AppStorePurchaseFlow {
}
}

// swiftlint:enable cyclomatic_complexity
@discardableResult
public func completeSubscriptionPurchase(with transactionJWS: TransactionJWS) async -> Result<PurchaseUpdate, AppStorePurchaseFlowError> {

Expand Down
1 change: 0 additions & 1 deletion Sources/Subscription/SubscriptionURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public enum SubscriptionURL {
case manageSubscriptionsInAppStore
case identityTheftRestoration

// swiftlint:disable:next cyclomatic_complexity
public func subscriptionURL(environment: SubscriptionEnvironment.ServiceEnvironment) -> URL {
switch self {
case .baseURL:
Expand Down

0 comments on commit c78c9a2

Please sign in to comment.