Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S1121: Assignments should not be made from within sub-expressions' should ignore chained assignments #167

Closed
fmallet opened this issue Mar 31, 2017 · 0 comments
Assignees
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@fmallet
Copy link
Contributor

fmallet commented Mar 31, 2017

For instance, an issue is raised here and should not be:
cPos = curLineStart = 0;

Why? Because this is a not-uncommon practice, and the intent is clear and should not confuse maintainers. Additionally, there's not a lot to be gained by updating it to:

i = 0;
j = 0;
{code}
and it would perhaps be a regression in terms of readability to update it to
{code}
i = 0;
j = i;

Relates to RSPEC-1121 Assignments should not be made from within sub-expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

3 participants