hackedteam/core-ios

View on GitHub

Showing 53 of 104 total issues

Avoid deeply nested control flow statements.
Open

                        if (j < numKeys) {
                            var key = page.rows[i][j]
                            
                            var keyView = self.createKey(key, vibrancy: key.isSpecial ? specialKeyVibrancy : normalKeyVibrancy)
                            
Severity: Major
Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 45 mins to fix

    Function specialKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        class func specialKey(darkMode: Bool, solidColorMode: Bool) -> UIColor {
            if darkMode {
                if solidColorMode {
                    return self.darkModeSolidColorSpecialKey
                }
    Severity: Minor
    Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 45 mins 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 layoutSpecialKeysRow has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        func layoutSpecialKeysRow(row: [Key], modelToView: [Key:KeyboardKey], gapWidth: CGFloat, leftSideRatio: CGFloat, rightSideRatio: CGFloat, frame: CGRect) {
    Severity: Minor
    Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 45 mins to fix

      Function layoutCharacterRow has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          func layoutCharacterRow(row: [Key], modelToView: [Key:KeyboardKey], keyWidth: CGFloat, gapWidth: CGFloat, frame: CGRect) {
      Severity: Minor
      Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 35 mins to fix

        Function layoutSubviews has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            override func layoutSubviews() {
                if !self.dirty {
                    if self.bounds.width == 0 || self.bounds.height == 0 {
                        return
                    }
        Severity: Minor
        Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardKeyBackground.swift - About 35 mins 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 layoutSubviews has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            override func layoutSubviews() {
                self.layoutPopupIfNeeded()
                
                var boundingBox = (self.popup != nil ? CGRectUnion(self.bounds, self.popup!.frame) : self.bounds)
                
        Severity: Minor
        Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardKey.swift - About 35 mins 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

        Avoid too many return statements within this function.
        Open

                        return ""
        Severity: Major
        Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardModel.swift - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return self.rounded(returnHeight)
          Severity: Major
          Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return self.uppercaseOutput!
            Severity: Major
            Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardModel.swift - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return self.rounded(returnWidth)
              Severity: Major
              Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardLayout.swift - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return self.uppercaseKeyCap!
                Severity: Major
                Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardModel.swift - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return ""
                  Severity: Major
                  Found in ios-newsstand-app/newsstand-app/Keyboard/KeyboardModel.swift - About 30 mins to fix

                    Method login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def login(host, port, user, pass)
                        @host = host || '127.0.0.1'
                        @port = port || 443
                        @http = Net::HTTP.new(@host, @port)
                        @http.use_ssl = true
                    Severity: Minor
                    Found in tools/Debug/rcs-core.rb - About 25 mins 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