MarioIannotta/PullUpController

View on GitHub

Showing 6 of 6 total issues

File PullUpController.swift has 366 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import UIKit

open class PullUpController: UIViewController {
    
    public enum Action {
Severity: Minor
Found in PullUpController/PullUpController.swift - About 4 hrs to fix

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

    open class PullUpController: UIViewController {
        
        public enum Action {
            /**
             The action used when the pull up controller's view is added to its parent view
    Severity: Minor
    Found in PullUpController/PullUpController.swift - About 2 hrs to fix

      Function setTopOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private func setTopOffset(_ value: CGFloat,
                                    animationDuration: TimeInterval? = nil,
                                    allowBounce: Bool = false) {
              guard
                  let parentViewHeight = parent?.view.frame.height
      Severity: Minor
      Found in PullUpController/PullUpController.swift - About 1 hr to fix

        Function handleScrollViewGestureRecognizer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @objc private func handleScrollViewGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer) {
                guard
                    isPortrait,
                    let scrollView = internalScrollView,
                    let topConstraint = topConstraint,
        Severity: Minor
        Found in PullUpController/PullUpController.swift - About 1 hr to fix

          Function setTopOffset has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private func setTopOffset(_ value: CGFloat,
                                        animationDuration: TimeInterval? = nil,
                                        allowBounce: Bool = false) {
                  guard
                      let parentViewHeight = parent?.view.frame.height
          Severity: Minor
          Found in PullUpController/PullUpController.swift - About 45 mins 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 handleScrollViewGestureRecognizer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              @objc private func handleScrollViewGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer) {
                  guard
                      isPortrait,
                      let scrollView = internalScrollView,
                      let topConstraint = topConstraint,
          Severity: Minor
          Found in PullUpController/PullUpController.swift - About 35 mins 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

          Severity
          Category
          Status
          Source
          Language