supermarin/xcpretty

View on GitHub

Showing 10 of 12 total issues

Class Simple has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Simple < Formatter

    PASS = "✓"
    FAIL = "✗"
    PENDING = "⧖"
Severity: Minor
Found in lib/xcpretty/formatters/simple.rb - About 4 hrs to fix

    Method parse has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def parse(text)
          update_test_state(text)
          update_error_state(text)
          update_linker_failure_state(text)
    
    
    Severity: Major
    Found in lib/xcpretty/parser.rb - About 4 hrs to fix

      File parser.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module XCPretty
      
        module Matchers
      
          # @regex Captured groups
      Severity: Minor
      Found in lib/xcpretty/parser.rb - About 4 hrs to fix

        Method status_symbol has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            def status_symbol(status)
              case status
              when :pass
                green(use_unicode? ? PASS : ASCII_PASS)
              when :fail
        Severity: Minor
        Found in lib/xcpretty/formatters/simple.rb - About 2 hrs 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

        Class Parser has 22 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Parser
        
            include Matchers
            include Matchers::Errors
            include Matchers::Warnings
        Severity: Minor
        Found in lib/xcpretty/parser.rb - About 2 hrs to fix

          Method format_compile_error has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def format_compile_error(file_name, file_path, reason,
                                       line, cursor);                    EMPTY; end
          Severity: Minor
          Found in lib/xcpretty/formatters/formatter.rb - About 35 mins to fix

            Method format_compile_warning has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def format_compile_warning(file, file_path, reason, line, cursor)
            Severity: Minor
            Found in lib/xcpretty/formatters/formatter.rb - About 35 mins to fix

              Method format_compile_warning has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def format_compile_warning(file_name, file_path, reason,
                                             line, cursor);                  EMPTY; end
              Severity: Minor
              Found in lib/xcpretty/formatters/formatter.rb - About 35 mins to fix

                Method format_compile_error has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def format_compile_error(file, file_path, reason, line, cursor)
                Severity: Minor
                Found in lib/xcpretty/formatters/formatter.rb - About 35 mins to fix

                  Method load_screenshots has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def load_screenshots
                        Dir.foreach(SCREENSHOT_DIR) do |item|
                          next if item == '.' || item == '..' || File.extname(item) != '.png'
                  
                          test = find_test(item)
                  Severity: Minor
                  Found in lib/xcpretty/reporters/html.rb - 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

                  Severity
                  Category
                  Status
                  Source
                  Language