Skip to content

[WIP] add more YARD docs#36

Open
jbodah wants to merge 1 commit into
tcopeland:masterfrom
jbodah:add-docs
Open

[WIP] add more YARD docs#36
jbodah wants to merge 1 commit into
tcopeland:masterfrom
jbodah:add-docs

Conversation

@jbodah

@jbodah jbodah commented Jun 17, 2015

Copy link
Copy Markdown
Contributor

@tcopeland this PR has a couple shout outs to you. Would you mind explaining what the notated blocks are doing?

This branch depends on #35 for doc links to be correct

Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcopeland would you mind explaining what's going on here?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey sorry for the delay in replying @jbodah.

The problem this is trying to solve is illustrated in this sequence of method calls:

x = foo.select {|y| y > 2 }
z = x.first
x.each {|q| puts q }

Normally pippi would flag that code since select is called and then first is called on the result. But in this case, the result is also used as a collection later - that is, we call each on it. So the code can't be simplified down into a single call to detect.

Pippi's logic is more or less to add a Problem, and then remove it if needed. There might be a nicer way to do that... like, adding it as a provisional problem and not actually adding it to the report until we confirm it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants