Skip to content

False Positive for Performance/FixedSize #54

@dzirtusss

Description

@dzirtusss

Performance/FixedSize should not be triggered for constants definitions.


Expected behavior

SOME_CONST = "abc".length      # this works ok
SOME_CONST = "abc".length + 1  # should also work and not trigger cop

Actual behavior

SOME_CONST = "abc".length      # this works ok
SOME_CONST = "abc".length + 1  # this triggers Performance/FixedSize

Steps to reproduce the problem

SOME_CONST = "abc".length
SOME_CONST = "abc".length + 1

RuboCop version

0.67.2 (using Parser 2.6.2.1, running on ruby 2.5.3 x86_64-darwin18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions