Lambda-School-Labs/community-calendar-ios

View on GitHub

Showing 254 of 254 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    func createAttrText(with title: String, color: UIColor, fontName: String) -> NSAttributedString {
        guard let font = UIFont(name: fontName, size: 14) else { return NSAttributedString() }
        let attrString = NSAttributedString(string: title,
            attributes: [NSAttributedString.Key.foregroundColor: color, NSAttributedString.Key.font: font])
        return attrString
Community Calendar/Community Calendar/Helpers/String+Extension.swift on lines 26..31
Community Calendar/Community Calendar/View Controllers/SettingsLauncher.swift on lines 177..182
Community Calendar/Community Calendar/ViewControllerExtensions/EventVC+CollectionView.swift on lines 354..359

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function showInCalendar has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @IBAction func showInCalendar(_ sender: Any) {
        eventStore.requestAccess(to: .event) { (granted, error) in
            if let error = error {
                NSLog("\(#file):L\(#line): Unable to request access to calendar in \(#function) with error: \(error)")
                return

    Function updateViews has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        func updateViews() {
            guard let filter = filter, let filterUsedLabel = filterUsedLabel else { return }
            imageButton.backgroundColor = UIColor(red: 0.84, green: 0.84, blue: 0.84, alpha: 1.0)
            imageButton.layer.cornerRadius = 5
            imageButton.layer.borderWidth = 1

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          func isGreaterThan(date: Date) -> Bool? {
              // Convert date to string and back to get date representented by only day, month, and year so that if two dates are the same day, they'll return false
              let thisString = filterDateFormatter.string(from: self)
              let thatString = filterDateFormatter.string(from: date)
              guard let this = filterDateFormatter.date(from: thisString),
      Community Calendar/Community Calendar/Helpers/Date+Extension.swift on lines 59..65

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          func isLessThan(date: Date) -> Bool? {
              let thisString = filterDateFormatter.string(from: self)
              let thatString = filterDateFormatter.string(from: date)
              guard let this = filterDateFormatter.date(from: thisString),
                  let that = filterDateFormatter.date(from: thatString) else { return nil }
      Community Calendar/Community Calendar/Helpers/Date+Extension.swift on lines 50..57

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func blackShadow(scale: Bool = true) {
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.shadowOpacity = 0.8
              layer.shadowOffset = CGSize(width: 0, height: 0)
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func gradientShadow1(scale: Bool = true) {
              
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.shadowOpacity = 0.8
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func settingsShadow(scale: Bool = true) {
              
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.shadowOpacity = 0.9
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func calendarShadow(scale: Bool = true) {
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.shadowOpacity = 0.9
              layer.shadowOffset = CGSize(width: 0, height: 0)
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func imageShadow(scale: Bool = true) {
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.opacity = 1.0
              layer.shadowOffset = CGSize(width: 0, height: 0)
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func gradientShadow2(scale: Bool = true) {
              layer.masksToBounds = false
              layer.shadowColor = UIColor.black.cgColor
              layer.shadowOpacity = 0.5
              layer.shadowOffset = CGSize(width: -3, height: -3)
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 52..60
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

          func whiteShadow(scale: Bool = true) {
              layer.masksToBounds = false
              layer.shadowColor = UIColor.white.cgColor
              layer.shadowOpacity = 0.3
              layer.shadowOffset = CGSize(width: 0, height: 0)
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 13..21
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 23..31
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 42..50
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 101..111
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 113..121
      Community Calendar/Community Calendar/Helpers/UIView+DropShadow.swift on lines 123..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          public init(events: [Event]? = nil) {
            self.init(unsafeResultMap: ["__typename": "Query", "events": events.flatMap { (value: [Event]) -> [ResultMap] in value.map { (value: Event) -> ResultMap in value.resultMap } }])
          }
      Severity: Major
      Found in Community Calendar/Community Calendar/API.swift and 3 other locations - About 1 hr to fix
      Community Calendar/Community Calendar/API.swift on lines 74..76
      Community Calendar/Community Calendar/API.swift on lines 635..637
      Community Calendar/Community Calendar/API.swift on lines 1195..1197

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 91.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

            public init(rsvps: [Rsvp]? = nil) {
              self.init(unsafeResultMap: ["__typename": "User", "rsvps": rsvps.flatMap { (value: [Rsvp]) -> [ResultMap] in value.map { (value: Rsvp) -> ResultMap in value.resultMap } }])
            }
      Severity: Major
      Found in Community Calendar/Community Calendar/API.swift and 3 other locations - About 1 hr to fix
      Community Calendar/Community Calendar/API.swift on lines 74..76
      Community Calendar/Community Calendar/API.swift on lines 1195..1197
      Community Calendar/Community Calendar/API.swift on lines 1617..1619

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 91.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          public init(events: [Event]? = nil) {
            self.init(unsafeResultMap: ["__typename": "Query", "events": events.flatMap { (value: [Event]) -> [ResultMap] in value.map { (value: Event) -> ResultMap in value.resultMap } }])
          }
      Severity: Major
      Found in Community Calendar/Community Calendar/API.swift and 3 other locations - About 1 hr to fix
      Community Calendar/Community Calendar/API.swift on lines 635..637
      Community Calendar/Community Calendar/API.swift on lines 1195..1197
      Community Calendar/Community Calendar/API.swift on lines 1617..1619

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 91.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

            public init(createdEvents: [CreatedEvent]? = nil) {
              self.init(unsafeResultMap: ["__typename": "User", "createdEvents": createdEvents.flatMap { (value: [CreatedEvent]) -> [ResultMap] in value.map { (value: CreatedEvent) -> ResultMap in value.resultMap } }])
            }
      Severity: Major
      Found in Community Calendar/Community Calendar/API.swift and 3 other locations - About 1 hr to fix
      Community Calendar/Community Calendar/API.swift on lines 74..76
      Community Calendar/Community Calendar/API.swift on lines 635..637
      Community Calendar/Community Calendar/API.swift on lines 1617..1619

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 91.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function prepare has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
              if segue.identifier == "ShowFeaturedDetailSegue" {
                  guard let detailVC = segue.destination as? EventDetailViewController,
                      let indexPath = featuredCollectionView.indexPathsForSelectedItems?.first else { return }
                  detailVC.indexPath = indexPath

        Function editingUserProfile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func editingUserProfile() {
                guard let apolloController = apolloController else { return }
                if isEditingUser {
                    firstNameTextField.text = apolloController.currentUser?.firstName
                    lastNameTextField.text = apolloController.currentUser?.lastName

          Function perform has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static func perform(authRequest: OIDAuthorizationRequest, callback: @escaping OIDAuthorizationCallback) {
                  var urlRequest = URLRequest(url: authRequest.externalUserAgentRequestURL())
                  urlRequest.httpMethod = "GET"
                  urlRequest.allHTTPHeaderFields = [
                      "Accept": "application/json",

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if options.contains(.revokeAccessToken) {
                        progressHandler(.revokeAccessToken)
                        authStateManager.revoke(authStateManager.accessToken) { (success, error) in
                            notFinishedOptions.remove(.revokeAccessToken)
                            if !success {
            Community Calendar/Pods/OktaOidc/Okta/OktaOidc/Internal/OktaOidcSignOutHandler.swift on lines 51..64

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 87.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language