Showing 121 of 244 total issues
Function searchForText
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func searchForText(_ searchText: String?, scope: Int) {
guard let text = searchText, !text.isEmpty else {
self.filteredList = self.dataList
return
Function setupTextFieldView
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setupTextFieldView() {
guard let textFieldView = activeConfiguration.textFieldViewInfo?.textFieldView else {
return
}
Function updateRootController
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private func updateRootController(info: IQTextFieldViewInfo?) {
guard let info = info,
let controller: UIViewController = info.textFieldView.iq.parentContainerViewController() else {
if let rootControllerConfiguration = rootControllerConfiguration,
- 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 topMostController
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
func topMostController() -> UIViewController? {
var controllersHierarchy: [UIViewController] = []
if var topController: UIViewController = base.window?.rootViewController {
- 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 removeToolbarIfRequired
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
internal func removeToolbarIfRequired() { // (Bug ID: #18)
guard let siblings: [UIView] = responderViews(), !siblings.isEmpty,
let textField: UIView = activeConfiguration.textFieldViewInfo?.textFieldView,
textField.responds(to: #selector(setter: UITextField.inputAccessoryView)),
Function addPreviousNextRightOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextRightOnKeyboardWithTarget(_ target: AnyObject?,
rightButtonImage: UIImage,
previousAction: Selector,
nextAction: Selector,
rightButtonAction: Selector,
Function addPreviousNextRightOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextRightOnKeyboardWithTarget(_ target: AnyObject?,
rightButtonTitle: String,
previousAction: Selector,
nextAction: Selector,
rightButtonAction: Selector,
Function addRightLeftOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addRightLeftOnKeyboardWithTarget(_ target: AnyObject?,
leftButtonTitle: String,
rightButtonTitle: String,
leftButtonAction: Selector,
rightButtonAction: Selector,
Function addRightLeftOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addRightLeftOnKeyboardWithTarget(_ target: AnyObject?,
leftButtonImage: UIImage,
rightButtonImage: UIImage,
leftButtonAction: Selector,
rightButtonAction: Selector,
Function addPreviousNextRightOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextRightOnKeyboardWithTarget(_ target: AnyObject?,
rightButtonImage: UIImage,
previousAction: Selector,
nextAction: Selector,
rightButtonAction: Selector,
Function addPreviousNextRightOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextRightOnKeyboardWithTarget(_ target: AnyObject?,
rightButtonTitle: String,
previousAction: Selector,
nextAction: Selector,
rightButtonAction: Selector,
Function addRightLeftOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addRightLeftOnKeyboardWithTarget(_ target: AnyObject?,
leftButtonImage: UIImage,
rightButtonImage: UIImage,
leftButtonAction: Selector,
rightButtonAction: Selector,
Function addRightLeftOnKeyboardWithTarget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func addRightLeftOnKeyboardWithTarget(_ target: AnyObject?,
leftButtonTitle: String,
rightButtonTitle: String,
leftButtonAction: Selector,
rightButtonAction: Selector,
Function textFieldShouldReturn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@objc public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
var isReturn: Bool = true
if delegate == nil {
- 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 addPreviousNextDone
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextDone(target: AnyObject?,
previousAction: Selector, nextAction: Selector, doneAction: Selector,
title: String?, titleAccessibilityLabel: String? = nil) {
Avoid deeply nested control flow statements. Open
if isScrollableTextView,
nextScrollView == nil,
suggestedOffsetY >= 0 {
// Converting Rectangle according to window bounds.
Function addPreviousNextDoneOnKeyboardWithTarget
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextDoneOnKeyboardWithTarget(_ target: AnyObject?,
previousAction: Selector,
nextAction: Selector,
doneAction: Selector,
titleText: String?,
Function setupTextFieldView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func setupTextFieldView() {
guard let textFieldView = activeConfiguration.textFieldViewInfo?.textFieldView else {
return
}
- 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 addPreviousNextDone
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func addPreviousNextDone(target: AnyObject?, previousAction: Selector, nextAction: Selector, doneAction: Selector,
showPlaceholder: Bool = false, titleAccessibilityLabel: String? = nil) {
Avoid deeply nested control flow statements. Open
if animatedContentOffset {
scrollView.setContentOffset(newContentOffset, animated: UIView.areAnimationsEnabled)
} else {
scrollView.contentOffset = newContentOffset
}