hackiftekhar/IQKeyboardManager

View on GitHub

Showing 244 of 244 total issues

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

    func responderViews() -> [UIView]? {

        guard let textFieldView: UIView = activeConfiguration.textFieldViewInfo?.textFieldView else {
            return nil
        }

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

        @objc public func textFieldShouldClear(_ textField: UITextField) -> Bool {
    
            if delegate == nil {
    
                if let unwrapDelegate: UITextFieldDelegate = textFieldViewCachedInfo(textField)?.textFieldDelegate {
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 44..56
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 44..56

    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 102.

    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 5 locations. Consider refactoring.
    Open

        @objc public func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
    
            if delegate == nil {
    
                if let unwrapDelegate: UITextFieldDelegate = textFieldViewCachedInfo(textField)?.textFieldDelegate {
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 120..132
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 44..56

    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 102.

    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 5 locations. Consider refactoring.
    Open

        @objc public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
    
            if delegate == nil {
    
                if let unwrapDelegate: UITextFieldDelegate = textFieldViewCachedInfo(textField)?.textFieldDelegate {
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 44..56
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 120..132
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 44..56

    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 102.

    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 5 locations. Consider refactoring.
    Open

        @objc public func textViewShouldEndEditing(_ textView: UITextView) -> Bool {
    
            if delegate == nil {
    
                if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate {
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 44..56
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 120..132
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 30..42

    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 102.

    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 5 locations. Consider refactoring.
    Open

        @objc public func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
    
            if delegate == nil {
    
                if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate {
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 30..42
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 44..56
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextFieldDelegate.swift on lines 120..132
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 44..56

    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 102.

    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

        @IBAction func disableToolbarAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.disabledToolbarClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        @IBAction func enableInViewControllerAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.enabledDistanceHandlingClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        @IBAction func enableTouchOutsideAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.enabledTouchResignedClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        @IBAction func enableToolbarAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.enabledToolbarClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        @IBAction func disableInViewControllerAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        @IBAction func allowedPreviousNextAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.toolbarPreviousNextAllowedClasses.append(IQPreviousNextView.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 190..201
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215

    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 101.

    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

        @IBAction func disableTouchOutsideAction(_ sender: UISwitch) {
            self.view.endEditing(true)
            if sender.isOn {
                IQKeyboardManager.shared.disabledTouchResignedClasses.append(CustomViewController.self)
            } else {
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 1 hr to fix
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 135..147
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 149..161
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 163..175
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 177..188
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 203..215
    Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 217..229

    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 101.

    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

        public func textView(_ textView: UITextView,
                             textItemMenuWillDisplayFor textItem: UITextItem,
                             animator: UIContextMenuInteractionAnimating) {
            var aDelegate: UITextViewDelegate? = delegate
    
    
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 332..345

    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 98.

    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

        public func textView(_ textView: UITextView,
                             textItemMenuWillEndFor textItem: UITextItem,
                             animator: UIContextMenuInteractionAnimating) {
            var aDelegate: UITextViewDelegate? = delegate
    
    
    IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift on lines 317..330

    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 98.

    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 deepResponderViews has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        func deepResponderViews() -> [UIView] {
    
            // Array of (UITextField/UITextView's).
            var textfields: [UIView] = []
    
    
    Severity: Minor
    Found in IQKeyboardManagerSwift/UIKitExtensions/IQUIView+Hierarchy.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 sendEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        private func sendEvent() {
    
            if let textFieldViewInfo = textFieldViewInfo,
               let rootControllerConfiguration = rootControllerConfiguration,
               rootControllerConfiguration.isReady {
    Severity: Minor
    Found in IQKeyboardManagerSwift/Configuration/IQActiveConfiguration.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 goToNextResponderOrResign has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        @discardableResult
        internal func goToNextResponderOrResign(_ view: UIView) -> Bool {
    
            var superConsideredView: UIView?
    
    

    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 superviewOf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        func superviewOf<T: UIView>(type classType: T.Type, belowView: UIView? = nil) -> T? {
    
            var superView: UIView? = base.superview
    
            while let unwrappedSuperView: UIView = superView {
    Severity: Minor
    Found in IQKeyboardManagerSwift/UIKitExtensions/IQUIView+Hierarchy.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 addKeyboardListener has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        private func addKeyboardListener() {
            keyboardListener.registerSizeChange(identifier: "IQActiveConfiguration", changeHandler: { [self] name, _ in
    
                if let info = textFieldViewInfo, keyboardInfo.keyboardShowing {
                    if let rootControllerConfiguration = rootControllerConfiguration {
    Severity: Minor
    Found in IQKeyboardManagerSwift/Configuration/IQActiveConfiguration.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

    Severity
    Category
    Status
    Source
    Language