PullUpController/PullUpController.swift
File PullUpController.swift
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import UIKit
open class PullUpController: UIViewController {
public enum Action {
PullUpController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
open class PullUpController: UIViewController {
public enum Action {
/**
The action used when the pull up controller's view is added to its parent view
Function setTopOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private func setTopOffset(_ value: CGFloat,
animationDuration: TimeInterval? = nil,
allowBounce: Bool = false) {
guard
let parentViewHeight = parent?.view.frame.height
Function handleScrollViewGestureRecognizer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@objc private func handleScrollViewGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer) {
guard
isPortrait,
let scrollView = internalScrollView,
let topConstraint = topConstraint,
Function setTopOffset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private func setTopOffset(_ value: CGFloat,
animationDuration: TimeInterval? = nil,
allowBounce: Bool = false) {
guard
let parentViewHeight = parent?.view.frame.height
- Read upRead up
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
Open
@objc private func handleScrollViewGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer) {
guard
isPortrait,
let scrollView = internalScrollView,
let topConstraint = topConstraint,
- Read upRead up
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"