<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h3&gt;Block stuff&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;calling yield when you attach the block to an arg&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
def foo(&amp;amp;block)
  yield
end
&lt;/pre&gt;

&lt;ul&gt;
	&lt;li&gt;check for existence of the block when capturing and calling&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
def foo(&amp;amp;block)&lt;/li&gt;
	&lt;li&gt;if block&lt;/li&gt;
	&lt;li&gt;if !block.nil?&lt;/li&gt;
	&lt;li&gt;unless block.nil?&lt;br /&gt;
end&lt;br /&gt;
 &lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Hash stuff&lt;/h3&gt;
&lt;pre&gt;
options = {}
options[:a] = 4
options[:b] = 5
options[:c] = 6
 &lt;/pre&gt;
&lt;h3&gt;Methods&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;passing instance variables to instance methods&lt;/li&gt;
	&lt;li&gt;unused private methods (would need to check subclasses as well as instance methods)&lt;/li&gt;
	&lt;li&gt;Constants as methods (def foo; [:a, :b, :c]; end)&lt;/li&gt;
	&lt;li&gt;single letter variable names (maybe let them tune the length? meh)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Other&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;NoMethodException on NilClass&lt;/li&gt;
	&lt;li&gt;&lt;pre&gt;if x &amp;amp;&amp;amp; !x.nil? # tautology&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;&lt;pre&gt;if x &amp;amp;&amp;amp; x.nil? # contradiction&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Dead code like a return in the middle of a method&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Empty rescue block&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Empty ensure block&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;what the heck&amp;#8230;any empty block&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Redundant else keyword&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Suggest x = a || b instead of&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
if a&lt;br /&gt;
  x = a&lt;br /&gt;
else&lt;br /&gt;
  x = b&lt;br /&gt;
end&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Redundant requires&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Unused methods/arguments (both for methods or blocks)&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2009-11-17T00:06:39-08:00</created-at>
  <id type="integer">163122</id>
  <permalink>suggested-checks</permalink>
  <repository-id type="integer">153976</repository-id>
  <title>Suggested Checks</title>
  <updated-at type="datetime">2009-04-04T19:36:10-07:00</updated-at>
  <user-id type="integer">14547</user-id>
</wiki>
