Showing 53 of 104 total issues
File KeyboardLayout.swift
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
import UIKit
// TODO: need to rename, consolidate, and define terms
class LayoutConstants: NSObject {
class var landscapeRatio: CGFloat { get { return 2 }}
Function generatePointsForDrawing
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
func generatePointsForDrawing(bounds: CGRect) {
// if geoHash[self] != nil {
// let values = geoHash[self]!
//
// self.fillPath = values.0
- 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 KeyboardKey.swift
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
import UIKit
// TODO: animation on color set
// TODO: correct corner radius
// TODO: correct colors
Function layoutKeys
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
func layoutKeys(model: Keyboard, views: [Key:KeyboardKey], bounds: CGRect) {
if bounds.height == 0 || bounds.width == 0 {
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 generatePointsForDrawing
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
func generatePointsForDrawing(bounds: CGRect) {
// if geoHash[self] != nil {
// let values = geoHash[self]!
//
// self.fillPath = values.0
Function updateColors
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
func updateColors() {
CATransaction.begin()
CATransaction.setDisableActions(true)
let switchColors = self.highlighted || self.selected
- 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 defaultKeyboard
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
func defaultKeyboard() -> Keyboard {
var defaultKeyboard = Keyboard()
for key in ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"] {
var keyModel = Key(.Character)
Function createViews
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
func createViews(keyboard: Keyboard) {
let specialKeyVibrancy: VibrancyType? = (self.darkMode ? VibrancyType.DarkSpecial : VibrancyType.LightSpecial)
let normalKeyVibrancy: VibrancyType? = (self.darkMode ? VibrancyType.DarkRegular : nil)
for (h, page) in enumerate(keyboard.pages) {
- 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 generatePointsForDrawing
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
override func generatePointsForDrawing(bounds: CGRect) {
//////////////////
// prepare data //
//////////////////
Function updateMessages
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
func updateMessages(beforeInput: String?, insert: String?, afterInput: String?) {
if self.SYNC_MOSTRECENT == true {
if let mostRecentStored = self.getMostRecentStoredMessage() {
self.mostRecentMessage = mostRecentStored
- 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 setAppearanceForKey
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
func setAppearanceForKey(key: KeyboardKey, model: Key, darkMode: Bool, solidColorMode: Bool) {
if model.type == Key.KeyType.Other {
self.setAppearanceForOtherKey(key, model: model, darkMode: darkMode, solidColorMode: solidColorMode)
}
- 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 setAppearanceForKey
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setAppearanceForKey(key: KeyboardKey, model: Key, darkMode: Bool, solidColorMode: Bool) {
if model.type == Key.KeyType.Other {
self.setAppearanceForOtherKey(key, model: model, darkMode: darkMode, solidColorMode: solidColorMode)
}
File rcs-core.rb
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'net/http'
require 'json'
require 'open-uri'
require 'pp'
require 'cgi'
Function layoutKeys
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
func layoutKeys(model: Keyboard, views: [Key:KeyboardKey], bounds: CGRect) {
if bounds.height == 0 || bounds.width == 0 {
return
}
Function updateColors
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateColors() {
CATransaction.begin()
CATransaction.setDisableActions(true)
let switchColors = self.highlighted || self.selected
Function layoutSpecialKeysRow
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
func layoutSpecialKeysRow(row: [Key], modelToView: [Key:KeyboardKey], gapWidth: CGFloat, leftSideRatio: CGFloat, rightSideRatio: CGFloat, frame: CGRect) {
var keysBeforeSpace = 0
var keysAfterSpace = 0
var reachedSpace = false
for (k, key) in enumerate(row) {
- 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 drawGlobe
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
func drawGlobe(bounds: CGRect, color: UIColor) {
let factors = getFactors(CGSizeMake(41, 40), bounds)
let xScalingFactor = factors.xScalingFactor
let yScalingFactor = factors.yScalingFactor
let lineWidthScalingFactor = factors.lineWidthScalingFactor
Function updateMessages
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateMessages(beforeInput: String?, insert: String?, afterInput: String?) {
if self.SYNC_MOSTRECENT == true {
if let mostRecentStored = self.getMostRecentStoredMessage() {
self.mostRecentMessage = mostRecentStored
Function layoutSpecialKeysRow
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
func layoutSpecialKeysRow(row: [Key], modelToView: [Key:KeyboardKey], gapWidth: CGFloat, leftSideRatio: CGFloat, rightSideRatio: CGFloat, frame: CGRect) {
var keysBeforeSpace = 0
var keysAfterSpace = 0
var reachedSpace = false
for (k, key) in enumerate(row) {
Function generatePointsForDrawing
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
override func generatePointsForDrawing(bounds: CGRect) {
//////////////////
// prepare data //
//////////////////
- 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"