hlfcoding/Eventual

View on GitHub

Showing 58 of 231 total issues

File EventViewController.swift has 477 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import UIKit
import EventKit

import MapKit

Severity: Minor
Found in Eventual/Eventual/EventViewController.swift - About 7 hrs to fix

    File MonthsViewController.swift has 394 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import UIKit
    import EventKit
    
    final class MonthsViewController: UICollectionViewController, MonthsScreen,
    CollectionViewTraitDelegate {
    Severity: Minor
    Found in Eventual/Eventual/MonthsViewController.swift - About 5 hrs to fix

      File ZoomTransition.swift has 391 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import UIKit
      import QuartzCore
      
      enum ZoomTransitionFrameFitting: String {
          case zoomedInAspectFittingZoomedOut
      Severity: Minor
      Found in Eventual/Eventual/ZoomTransition.swift - About 5 hrs to fix

        Function sync has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            @objc private func sync(_ sender: CADisplayLink) {
                guard collectionView.contentOffset.y >= 0,
                    collectionView.contentOffset.y != collectionView.previousContentOffset?.y
                    else { return }
        
        
        Severity: Minor
        Found in Eventual/Eventual/CollectionViewTitleScrollSyncTrait.swift - About 5 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File TitleScrollView.swift has 319 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import UIKit
        import QuartzCore
        
        enum TitleItemType {
        
        
        Severity: Minor
        Found in Eventual/Eventual/TitleScrollView.swift - About 3 hrs to fix

          Function transitionFocus has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

              override func transitionFocus(to view: UIView?, from currentView: UIView? = nil,
                                            completion: (() -> Void)? = nil) {
                  let isPicker = (from: currentView is UIDatePicker, to: view is UIDatePicker)
                  let shouldToggleDrawer = isPicker.from || isPicker.to && !(isPicker.from && isPicker.to)
                  var toggleDrawerDelay: TimeInterval?
          Severity: Minor
          Found in Eventual/Eventual/EventViewController.swift - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          FormViewController has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class FormViewController: UIViewController, FormDataSourceDelegate, FormFocusStateDelegate {
          
              // MARK: - UIViewController
          
              override func viewDidLoad() {
          Severity: Minor
          Found in Eventual/Eventual/FormViewController.swift - About 3 hrs to fix

            EventViewController has 28 methods (exceeds 20 allowed). Consider refactoring.
            Open

            final class EventViewController: FormViewController, EventScreen {
            
                // MARK: CoordinatedViewController
            
                weak var currentSegue: UIStoryboardSegue?
            Severity: Minor
            Found in Eventual/Eventual/EventViewController.swift - About 3 hrs to fix

              Function indexPathUpdatesForEvent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  func indexPathUpdatesForEvent(newInfo: EventWithChangeInfo,
                                                oldInfo: EventWithChangeInfo) -> SelectiveUpdatingInfo {
                      var paths = (deletions: [IndexPath](), insertions: [IndexPath](), reloads: [IndexPath](),
                                   sectionDeletions: IndexSet(), sectionInsertions: IndexSet())
              
              
              Severity: Minor
              Found in Eventual/Eventual/EventCollections.swift - About 3 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              File DayViewController.swift has 292 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import UIKit
              import EventKit
              
              final class DayViewController: UICollectionViewController, DayScreen {
              
              
              Severity: Minor
              Found in Eventual/Eventual/DayViewController.swift - About 3 hrs to fix

                Function handleLongPress has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    @objc private func handleLongPress(_ sender: UILongPressGestureRecognizer) {
                        guard sender === longPressRecognizer else { preconditionFailure() }
                        let location = longPressRecognizer.location(in: collectionView)
                
                        let handleReattach = { (cell: UICollectionViewCell, indexPath: IndexPath) in
                Severity: Minor
                Found in Eventual/Eventual/CollectionViewDragDropDeletionTrait.swift - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function sync has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @objc private func sync(_ sender: CADisplayLink) {
                        guard collectionView.contentOffset.y >= 0,
                            collectionView.contentOffset.y != collectionView.previousContentOffset?.y
                            else { return }
                
                
                Severity: Major
                Found in Eventual/Eventual/CollectionViewTitleScrollSyncTrait.swift - About 2 hrs to fix

                  Function handleLongPress has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @objc private func handleLongPress(_ sender: UILongPressGestureRecognizer) {
                          guard sender === longPressRecognizer else { preconditionFailure() }
                          let location = longPressRecognizer.location(in: collectionView)
                  
                          let handleReattach = { (cell: UICollectionViewCell, indexPath: IndexPath) in
                  Severity: Major
                  Found in Eventual/Eventual/CollectionViewDragDropDeletionTrait.swift - About 2 hrs to fix

                    Function handlePan has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @objc private func handlePan(_ sender: UIPanGestureRecognizer) {
                            let translation = sender.translation(in: sender.view!.superview!)
                            let velocity = sender.velocity(in: sender.view!)
                            switch sender.state {
                            case .began:
                    Severity: Minor
                    Found in Eventual/Eventual/CarouselTransition.swift - About 2 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function prepareSegueForDescendant has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        override func prepareSegueForDescendant(_ sender: Any?) {
                            super.prepareSegueForDescendant(sender)
                    
                            let viewController = sender as! CoordinatedViewController
                            let (type, destination, source, destinationContainer, sourceContainer) =
                    Severity: Major
                    Found in Eventual/Eventual/MonthEventNavigationController.swift - About 2 hrs to fix

                      EventCollectionsTests has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      final class EventCollectionsTests: XCTestCase {
                      
                          lazy var tomorrowEvents: [TestEvent] = [
                              TestEvent(identifier: "Tomorrow-0", startDate: tomorrow),
                              TestEvent(identifier: "Tomorrow-1", startDate: tomorrow),
                      Severity: Minor
                      Found in Eventual/Eventual Unit Tests/EventCollectionsTests.swift - About 2 hrs to fix

                        Function prepareSegueForDescendant has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            override func prepareSegueForDescendant(_ sender: Any?) {
                                super.prepareSegueForDescendant(sender)
                        
                                let viewController = sender as! CoordinatedViewController
                                let (type, destination, source, destinationContainer, sourceContainer) =
                        Severity: Minor
                        Found in Eventual/Eventual/MonthEventNavigationController.swift - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function indexPathUpdatesForEvent has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            func indexPathUpdatesForEvent(newInfo: EventWithChangeInfo,
                                                          oldInfo: EventWithChangeInfo) -> SelectiveUpdatingInfo {
                                var paths = (deletions: [IndexPath](), insertions: [IndexPath](), reloads: [IndexPath](),
                                             sectionDeletions: IndexSet(), sectionInsertions: IndexSet())
                        
                        
                        Severity: Minor
                        Found in Eventual/Eventual/EventCollections.swift - About 1 hr to fix

                          Function transitionFocus has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              override func transitionFocus(to view: UIView?, from currentView: UIView? = nil,
                                                            completion: (() -> Void)? = nil) {
                                  let isPicker = (from: currentView is UIDatePicker, to: view is UIDatePicker)
                                  let shouldToggleDrawer = isPicker.from || isPicker.to && !(isPicker.from && isPicker.to)
                                  var toggleDrawerDelay: TimeInterval?
                          Severity: Minor
                          Found in Eventual/Eventual/EventViewController.swift - About 1 hr to fix

                            Function setUp has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                func setUp() {
                                    scrollView.translatesAutoresizingMaskIntoConstraints = false
                                    addSubview(scrollView)
                                    NSLayoutConstraint.activate([
                                        scrollView.centerXAnchor.constraint(equalTo: centerXAnchor),
                            Severity: Minor
                            Found in Eventual/Eventual/TitleScrollView.swift - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language