Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sonarcloud updates #845

Closed
wants to merge 26 commits into from
Closed

chore: sonarcloud updates #845

wants to merge 26 commits into from

Conversation

jnewc
Copy link
Contributor

@jnewc jnewc commented Apr 23, 2024

Description

CHKT-XXXX

  • What do these changes do?
  • Note any breaking changes and why they are necessary

Other Notes

  • Other changes that are not specifically related to the intent of the PR

Manual Testing

Add manual testing notes here if applicable, otherwise remove this section

Screenshots

If applicable, otherwise remove this section

Contributor Checklist

  • All status checks have passed prior to code review
  • I have added unit tests to a reasonable level of coverage where suitable
  • I have added UI tests to new user flows, if applicable
  • I have manually tested newly added UX
  • I have open a documentation PR, if applicable

Reviewer Checklist

  • I have verified that a suitable set of automated tests has been added
  • I have verified that the title prefix aligns to the code changes + whether a release is expected after merging the PR
  • I have verified the documentation PR aligns with this PR, if applicable

Before Merging

  • If introducing a breaking change, I have communicated it internally
  • Any related documentation PRs are ready to merge

Other Stuff

  • You can find out more about our automation checks here
  • Find out more about conventional commits here

Copy link
Contributor

github-actions bot commented Apr 23, 2024

Warnings
⚠️ Please assign someone aside from CODEOWNERS (@checkout-pci-reviewers) to review this PR.

Generated by 🚫 Danger Swift against 4ab0f85

@@ -63,15 +63,15 @@ extension PrimerHeadlessKlarnaComponent: PrimerKlarnaProviderAuthorizationDelega
*/
public func primerKlarnaWrapperAuthorized(approved: Bool, authToken: String?, finalizeRequired: Bool) {
isFinalizationRequired = finalizeRequired
if approved == false {
if finalizeRequired == true {
if approved {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@@ -25,10 +25,10 @@ extension PrimerHeadlessKlarnaComponent: PrimerKlarnaProviderFinalizationDelegat
* - `authToken` - An optional `String` containing the authorization token, which is returned only if `approved` is `true`.
*/
public func primerKlarnaWrapperFinalized(approved: Bool, authToken: String?) {
if approved == false {
if approved {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@@ -117,7 +117,7 @@ extension UnkeyedDecodingContainer {

mutating func decode(_ type: Array<Any>.Type) throws -> [Any] {
var array: [Any] = []
while isAtEnd == false {
while isAtEnd {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@@ -23,7 +23,7 @@ class ClientSessionActionsModule: ClientSessionActionsProtocol {
return
}

if (PrimerAPIConfigurationModule.apiConfiguration?.hasSurchargeEnabled ?? false) == false {
if (PrimerAPIConfigurationModule.apiConfiguration?.hasSurchargeEnabled ?? false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
  • ⚠️ if, for, guard, switch, while, and catch statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses. (control_statement)

@@ -65,7 +65,7 @@ class ClientSessionActionsModule: ClientSessionActionsProtocol {
return
}

if (PrimerAPIConfigurationModule.apiConfiguration?.hasSurchargeEnabled ?? false) == false {
if (PrimerAPIConfigurationModule.apiConfiguration?.hasSurchargeEnabled ?? false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
  • ⚠️ if, for, guard, switch, while, and catch statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses. (control_statement)

}
}

// swiftlint:disable cyclomatic_complexity
fileprivate func showTexfieldViewErrorIfNeeded(for primerTextFieldView: PrimerTextFieldView, isValid: Bool?) {

if isValid == false {

Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Lines should not have trailing whitespace. (trailing_whitespace)

@@ -910,7 +909,7 @@ extension CardFormPaymentMethodTokenizationViewModel: PrimerTextFieldViewDelegat
extension CardFormPaymentMethodTokenizationViewModel {

private func updateButtonUI() {
if let amount = AppState.current.amount, self.uiModule.isSubmitButtonAnimating == false {
if let amount = AppState.current.amount, self.uiModule.isSubmitButtonAnimating {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@@ -146,15 +146,15 @@ internal class PrimerUIManager {
return
}

if case .checkout = PrimerInternal.shared.intent, paymentMethod.isCheckoutEnabled == false {
if case .checkout = PrimerInternal.shared.intent, paymentMethod.isCheckoutEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

let err = PrimerError.unsupportedIntent(
intent: .checkout,
userInfo: .errorUserInfoDictionary(),
diagnosticsId: UUID().uuidString)
seal.reject(err)
return

} else if case .vault = PrimerInternal.shared.intent, paymentMethod.isVaultingEnabled == false {
} else if case .vault = PrimerInternal.shared.intent, paymentMethod.isVaultingEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@@ -245,7 +245,7 @@ class ApplePayTokenizationViewModel: PaymentMethodTokenizationViewModel {
self.isCancelled = true

paymentController.present { success in
if success == false {
if success {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

@primer-io primer-io deleted a comment from github-actions bot Apr 23, 2024
@jnewc jnewc closed this Apr 24, 2024
@jnewc jnewc deleted the jn/sonarcloud-issues branch April 24, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant