Function layoutView
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
func layoutView() -> Void {
var frameOfLastBubble = CGRect.null
var lineCount = 0
for contactKey in self.contactKeys! {
- 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
File EVPickedContactsView.swift
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import UIKit
class EVPickedContactsView: UIView, EVContactBubbleDelegate, UITextViewDelegate, UIScrollViewDelegate {
// MARK: - Private Variables
Function layoutView
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
func layoutView() -> Void {
var frameOfLastBubble = CGRect.null
var lineCount = 0
for contactKey in self.contactKeys! {
EVPickedContactsView
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class EVPickedContactsView: UIView, EVContactBubbleDelegate, UITextViewDelegate, UIScrollViewDelegate {
// MARK: - Private Variables
fileprivate var _shouldSelectTextView = false
fileprivate var scrollView : UIScrollView?
Function setup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
fileprivate func setup() -> Void {
self.viewPadding = kViewPadding
self.contacts = [:]
self.contactKeys = []
Function setBubbleColor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func setBubbleColor(_ color: EVBubbleColor, selectedColor:EVBubbleColor) -> Void {
self.bubbleColor = color
self.bubbleSelectedColor = selectedColor
for contactKey in self.contactKeys! {
- 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 textView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
self.textView?.isHidden = false
if( text == "\n" ) {
return false
- 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 removeContact
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
func removeContact(_ contact : EVContactProtocol) -> Void {
// let contactKey = NSValue(nonretainedObject: contact)
let contactKey = contact.identifier
if let contacts = self.contacts {
- 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"