HipByte/codeclimate-rubymotion

View on GitHub

Showing 56 of 56 total issues

Assignment Branch Condition size for run is too high. [17.15/15]
Open

      def run
        Dir.chdir(@directory) do
          Dir["**/*.rb"].each do |path|
            parsed = RuboCop::ProcessedSource.new(File.read(path), path)

Severity: Minor
Found in lib/cc/engine/rubymotion.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for on_method_def is too high. [16.58/15]
Open

        def on_method_def(_node, _method_name, _args, body)
          return unless _method_name == :init
          return unless body
          return if body.self_type?

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method on_method_def has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def on_method_def(_node, _method_name, _args, body)
          return unless _method_name == :init
          return unless body
          return if body.self_type?

Severity: Minor
Found in lib/rubocop/cop/rubymotion/init_must_return_self.rb - About 55 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 method.
Open

          return if last_expr_in_body.self_type?
Severity: Major
Found in lib/rubocop/cop/rubymotion/init_must_return_self.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return if last_expr_in_body.return_type? && last_expr_in_body.children.last.self_type?
    Severity: Major
    Found in lib/rubocop/cop/rubymotion/init_must_return_self.rb - About 30 mins to fix

      Freeze mutable objects assigned to constants.
      Open

              MESSAGE = "When overriding the #dealloc method, super must be called."

      This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

      Example:

      # bad
      CONST = [1, 2, 3]
      
      # good
      CONST = [1, 2, 3].freeze

      Freeze mutable objects assigned to constants.
      Open

              MESSAGE = "When overriding the #init method, self must be returned."

      This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

      Example:

      # bad
      CONST = [1, 2, 3]
      
      # good
      CONST = [1, 2, 3].freeze

      Space inside parentheses detected.
      Open

            def initialize(directory: , io: , engine_config: )
      Severity: Minor
      Found in lib/cc/engine/rubymotion.rb by rubocop

      Checks for spaces inside ordinary round parentheses.

      Example:

      # bad
      f( 3)
      g = (a + 3 )
      
      # good
      f(3)
      g = (a + 3)

      Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      Open

      require 'json'
      Severity: Minor
      Found in lib/cc/engine/rubymotion.rb by rubocop

      Checks if uses of quotes match the configured preference.

      Example: EnforcedStyle: single_quotes (default)

      # bad
      "No special symbols"
      "No string interpolation"
      "Just text"
      
      # good
      'No special symbols'
      'No string interpolation'
      'Just text'
      "Wait! What's #{this}!"

      Example: EnforcedStyle: double_quotes

      # bad
      'Just some text'
      'No special chars or interpolation'
      
      # good
      "Just some text"
      "No special chars or interpolation"
      "Every string in #{project} uses double_quotes"

      Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      Open

      require 'rubocop/cop/rubymotion/dealloc_must_call_super'
      Severity: Minor
      Found in lib/cc/rubymotion_cops.rb by rubocop

      Checks if uses of quotes match the configured preference.

      Example: EnforcedStyle: single_quotes (default)

      # bad
      "No special symbols"
      "No string interpolation"
      "Just text"
      
      # good
      'No special symbols'
      'No string interpolation'
      'Just text'
      "Wait! What's #{this}!"

      Example: EnforcedStyle: double_quotes

      # bad
      'Just some text'
      'No special chars or interpolation'
      
      # good
      "Just some text"
      "No special chars or interpolation"
      "Every string in #{project} uses double_quotes"

      Extra empty line detected at module body beginning.
      Open

      
            class DeallocMustCallSuper < Cop

      This cops checks if empty lines around the bodies of modules match the configuration.

      Example: EnforcedStyle: empty_lines

      # good
      
      module Foo
      
        def bar
          # ...
        end
      
      end

      Example: EnforcedStyle: emptylinesexcept_namespace

      # good
      
      module Foo
        module Bar
      
          # ...
      
        end
      end

      Example: EnforcedStyle: emptylinesspecial

      # good
      module Foo
      
        def bar; end
      
      end

      Example: EnforcedStyle: noemptylines (default)

      # good
      
      module Foo
        def bar
          # ...
        end
      end

      Freeze mutable objects assigned to constants.
      Open

              MESSAGE = "Do not use retainCount"

      This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

      Example:

      # bad
      CONST = [1, 2, 3]
      
      # good
      CONST = [1, 2, 3].freeze

      Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      Open

      require 'rake/testtask'
      Severity: Minor
      Found in Rakefile by rubocop

      Checks if uses of quotes match the configured preference.

      Example: EnforcedStyle: single_quotes (default)

      # bad
      "No special symbols"
      "No string interpolation"
      "Just text"
      
      # good
      'No special symbols'
      'No string interpolation'
      'Just text'
      "Wait! What's #{this}!"

      Example: EnforcedStyle: double_quotes

      # bad
      'Just some text'
      'No special chars or interpolation'
      
      # good
      "Just some text"
      "No special chars or interpolation"
      "Every string in #{project} uses double_quotes"

      Space missing to the left of {.
      Open

                if body.each_node.none?{|x| x.type == :self }

      Checks that block braces have or don't have a space before the opening brace depending on configuration.

      Example:

      # bad
      foo.map{ |a|
        a.bar.to_s
      }
      
      # good
      foo.map { |a|
        a.bar.to_s
      }

      Trailing whitespace detected.
      Open

              private 

      Line is too long. [96/80]
      Open

                return if last_expr_in_body.return_type? && last_expr_in_body.children.last.self_type?

      Trailing whitespace detected.
      Open

                if (node.children.last == :retainCount) || 

      Space found before comma.
      Open

            def initialize(directory: , io: , engine_config: )
      Severity: Minor
      Found in lib/cc/engine/rubymotion.rb by rubocop

      Checks for comma (,) preceded by space.

      Example:

      # bad
      [1 , 2 , 3]
      a(1 , 2)
      each { |a , b| }
      
      # good
      [1, 2, 3]
      a(1, 2)
      each { |a, b| }

      Line is too long. [111/80]
      Open

      gem "rubocop", :git => 'https://github.com/mrb/rubocop.git', :ref => 'c4b6ae4c323172c81e0f8f18f54e4e36a03b73d1'
      Severity: Minor
      Found in Gemfile by rubocop

      Trailing whitespace detected.
      Open

              
      Severity
      Category
      Status
      Source
      Language