hackiftekhar/IQKeyboardManager

View on GitHub
Demo/Swift_Demo/ViewController/CustomViewController.swift

Summary

Maintainability
D
2 days
Test Coverage

Function viewWillAppear has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        do {
            let classes = IQKeyboardManager.shared.disabledDistanceHandlingClasses
Severity: Minor
Found in Demo/Swift_Demo/ViewController/CustomViewController.swift - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

                    return element == CustomViewController.self
    Severity: Major
    Found in Demo/Swift_Demo/ViewController/CustomViewController.swift - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return element == CustomViewController.self
      Severity: Major
      Found in Demo/Swift_Demo/ViewController/CustomViewController.swift - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return element == IQPreviousNextView.self
        Severity: Major
        Found in Demo/Swift_Demo/ViewController/CustomViewController.swift - About 30 mins to fix

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

                  do {
                      let classes = IQKeyboardManager.shared.enabledTouchResignedClasses
                      switchEnableTouchResign.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.disabledToolbarClasses
                      switchDisableToolbar.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.enabledDistanceHandlingClasses
                      switchEnableViewController.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.disabledDistanceHandlingClasses
                      switchDisableViewController.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.toolbarPreviousNextAllowedClasses
                      switchAllowPreviousNext.isOn = classes.contains(where: { element in
                          return element == IQPreviousNextView.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.enabledToolbarClasses
                      switchEnableToolbar.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 92..97
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

                  do {
                      let classes = IQKeyboardManager.shared.disabledTouchResignedClasses
                      switchDisableTouchResign.isOn = classes.contains(where: { element in
                          return element == CustomViewController.self
                      })
          Severity: Major
          Found in Demo/Swift_Demo/ViewController/CustomViewController.swift and 6 other locations - About 35 mins to fix
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 64..69
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 71..76
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 78..83
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 85..90
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 99..104
          Demo/Swift_Demo/ViewController/CustomViewController.swift on lines 106..111

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

          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

          There are no issues that match your filters.

          Category
          Status