diaspora/diaspora

View on GitHub
lib/diaspora/message_renderer.rb

Summary

Maintainability
A
25 mins
Test Coverage

Assignment Branch Condition size for append_and_truncate is too high. [21.05/20]
Open

      def append_and_truncate
        if options[:truncate]
          @message = message.truncate options[:truncate]-options[:append].to_s.size
        end

Severity: Minor
Found in lib/diaspora/message_renderer.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

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

      def render_mentions
        unless options[:disable_hovercards] || options[:mentioned_people].empty?
          @message = Diaspora::Mentionable.format message, options[:mentioned_people]
        end

Severity: Minor
Found in lib/diaspora/message_renderer.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

Tagging a string as html safe may be a security risk.
Open

      }.html_safe
Severity: Minor
Found in lib/diaspora/message_renderer.rb by rubocop

This cop checks for the use of output safety calls like htmlsafe, raw, and safeconcat. These methods do not escape content. They simply return a SafeBuffer containing the content as is. Instead, use safe_join to join content and escape it and concat to concatenate content and escape it, ensuring its safety.

Example:

user_content = "hi"

# bad
"

#{user_content}

".html_safe # => ActiveSupport::SafeBuffer "

hi

" # good content_tag(:p, user_content) # => ActiveSupport::SafeBuffer "

<b>hi</b>

" # bad out = "" out << "
  • #{user_content}
  • " out << "
  • #{user_content}
  • " out.html_safe # => ActiveSupport::SafeBuffer "
  • hi
  • hi
  • " # good out = [] out << content_tag(:li, user_content) out << content_tag(:li, user_content) safe_join(out) # => ActiveSupport::SafeBuffer # "
  • <b>hi</b>
  • <b>hi</b>
  • " # bad out = "

    trusted content

    ".html_safe out.safe_concat(user_content) # => ActiveSupport::SafeBuffer "

    trusted_content

    hi" # good out = "

    trusted content

    ".html_safe out.concat(user_content) # => ActiveSupport::SafeBuffer # "

    trusted_content

    <b>hi</b>" # safe, though maybe not good style out = "trusted content" result = out.concat(user_content) # => String "trusted contenthi" # because when rendered in ERB the String will be escaped: # # => trusted content<b>hi</b> # bad (user_content + " " + content_tag(:span, user_content)).html_safe # => ActiveSupport::SafeBuffer "hi <span><b>hi</b></span>" # good safe_join([user_content, " ", content_tag(:span, user_content)]) # => ActiveSupport::SafeBuffer # "<b>hi</b> <span>&lt;b&gt;hi&lt;/b&gt;</span>"

    Tagging a string as html safe may be a security risk.
    Open

          }.html_safe
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cop checks for the use of output safety calls like htmlsafe, raw, and safeconcat. These methods do not escape content. They simply return a SafeBuffer containing the content as is. Instead, use safe_join to join content and escape it and concat to concatenate content and escape it, ensuring its safety.

    Example:

    user_content = "hi"
    
    # bad
    "

    #{user_content}

    ".html_safe # => ActiveSupport::SafeBuffer "

    hi

    " # good content_tag(:p, user_content) # => ActiveSupport::SafeBuffer "

    <b>hi</b>

    " # bad out = "" out << "
  • #{user_content}
  • " out << "
  • #{user_content}
  • " out.html_safe # => ActiveSupport::SafeBuffer "
  • hi
  • hi
  • " # good out = [] out << content_tag(:li, user_content) out << content_tag(:li, user_content) safe_join(out) # => ActiveSupport::SafeBuffer # "
  • <b>hi</b>
  • <b>hi</b>
  • " # bad out = "

    trusted content

    ".html_safe out.safe_concat(user_content) # => ActiveSupport::SafeBuffer "

    trusted_content

    hi" # good out = "

    trusted content

    ".html_safe out.concat(user_content) # => ActiveSupport::SafeBuffer # "

    trusted_content

    <b>hi</b>" # safe, though maybe not good style out = "trusted content" result = out.concat(user_content) # => String "trusted contenthi" # because when rendered in ERB the String will be escaped: # # => trusted content<b>hi</b> # bad (user_content + " " + content_tag(:span, user_content)).html_safe # => ActiveSupport::SafeBuffer "hi <span><b>hi</b></span>" # good safe_join([user_content, " ", content_tag(:span, user_content)]) # => ActiveSupport::SafeBuffer # "<b>hi</b> <span>&lt;b&gt;hi&lt;/b&gt;</span>"

    Interpolation in single quoted string detected. Use double quoted strings if you need interpolation.
    Open

                    elsif /\A\#{1,6}\s+(?<atx_content>.{1,200}?)(?:\s+#+)?(?:\r?\n|$)/ =~ @text.lstrip
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cop checks for interpolation in a single quoted string.

    Example:

    # bad
    
    foo = 'something with #{interpolation} inside'

    Example:

    # good
    
    foo = "something with #{interpolation} inside"

    Use def with parentheses when there are parameters.
    Open

          def initialize message, options
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Align the elements of a hash literal if they span more than one line.
    Open

                      autolink: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                      strikethrough: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
    Open

            if options[:truncate]
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

    Example:

    # bad
    if condition
      do_stuff(bar)
    end
    
    unless qux.empty?
      Foo.do_something
    end
    
    # good
    do_stuff(bar) if condition
    Foo.do_something unless qux.empty?

    Align the elements of a hash literal if they span more than one line.
    Open

                      no_intra_emphasis: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                    append_after_truncate: nil,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                    escape_tags: false,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                    escape: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
    Open

            if options[:escape]
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

    Example:

    # bad
    if condition
      do_stuff(bar)
    end
    
    unless qux.empty?
      Foo.do_something
    end
    
    # good
    do_stuff(bar) if condition
    Foo.do_something unless qux.empty?

    Use def with parentheses when there are parameters.
    Open

        def plain_text_for_json opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Align the elements of a hash literal if they span more than one line.
    Open

                    link_all_mentions: false,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                    disable_hovercards: false,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Use def with parentheses when there are parameters.
    Open

            def process message, options, &block
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Use def with parentheses when there are parameters.
    Open

        def plain_text_without_markdown opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Use def with parentheses when there are parameters.
    Open

        def title opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Align the elements of a hash literal if they span more than one line.
    Open

        DEFAULTS = {mentioned_people: [],
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                      tables: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Use a guard clause instead of wrapping the code inside a conditional expression.
    Open

            if options[:escape]
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Use a guard clause instead of wrapping the code inside a conditional expression

    Example:

    # bad
    def test
      if something
        work
      end
    end
    
    # good
    def test
      return unless something
      work
    end
    
    # also good
    def test
      work if something
    end
    
    # bad
    if something
      raise 'exception'
    else
      ok
    end
    
    # good
    raise 'exception' if something
    ok

    Use def with parentheses when there are parameters.
    Open

        def markdownified opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Align the elements of a hash literal if they span more than one line.
    Open

                    truncate: false,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                      hard_wrap: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Use def with parentheses when there are parameters.
    Open

        def plain_text opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Align the elements of a hash literal if they span more than one line.
    Open

                      filter_html: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Avoid comma after the last item of a hash.
    Open

                      no_intra_emphasis: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cop checks for trailing comma in array and hash literals.

    Example: EnforcedStyleForMultiline: consistent_comma

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1, 2,
      3,
    ]
    
    # good
    a = [
      1,
      2,
    ]

    Example: EnforcedStyleForMultiline: comma

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1,
      2,
    ]

    Example: EnforcedStyleForMultiline: no_comma (default)

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1,
      2
    ]

    Use def with parentheses when there are parameters.
    Open

        def html opts={}
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Do not use semicolons to terminate expressions.
    Open

              x =~ /\n{2}/ ? x : (x.strip!; x << " \n")
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

    Example:

    # bad
    foo = 1; bar = 2;
    baz = 3;
    
    # good
    foo = 1
    bar = 2
    baz = 3

    Align the elements of a hash literal if they span more than one line.
    Open

                    squish: false,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Align the elements of a hash literal if they span more than one line.
    Open

                    markdown_options: {
                      autolink: true,
                      fenced_code_blocks:  true,
                      space_after_headers: true,
                      strikethrough: true,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Surrounding space missing for operator -.
    Open

              @message = message.truncate options[:truncate]-options[:append].to_s.size
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Align the elements of a hash literal if they span more than one line.
    Open

                    append: nil,
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

    - key (left align keys)
    - separator (align hash rockets and colons, right align keys)
    - table (left align keys, hash rockets, and values)

    The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

    - always_inspect
    - always_ignore
    - ignore_implicit (without curly braces)
    - ignore_explicit (with curly braces)

    Example:

    # EnforcedHashRocketStyle: key (default)
    # EnforcedColonStyle: key (default)
    
    # good
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    
    # bad
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Example:

    # EnforcedHashRocketStyle: separator
    # EnforcedColonStyle: separator
    
    #good
    {
      foo: bar,
       ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
      :ba => baz
    }
    {
      :foo => bar,
      :ba  => baz
    }

    Example:

    # EnforcedHashRocketStyle: table
    # EnforcedColonStyle: table
    
    #good
    {
      foo: bar,
      ba:  baz
    }
    {
      :foo => bar,
      :ba  => baz
    }
    
    #bad
    {
      foo: bar,
      ba: baz
    }
    {
      :foo => bar,
       :ba => baz
    }

    Use def with parentheses when there are parameters.
    Open

            def normalize message
    Severity: Minor
    Found in lib/diaspora/message_renderer.rb by rubocop

    This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parantheses when method definition arguments fit on single line,
    # but prefers parantheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

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

              return '' if message.blank? # Optimize for empty message
    Severity: Minor
    Found in lib/diaspora/message_renderer.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"

    There are no issues that match your filters.

    Category
    Status