<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: small improvements of the jqGrid code with respect of ReSharper 6</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on small improvements of the jqGrid code with respect of ReSharper 6</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p25674</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p25674</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>I use <a href="http://www.jetbrains.com/resharper/" target="_blank">ReSharper</a> 6.1 for my projects and find it&#39;s suggestions very clear. It can help in one click to fix the problem. If I open the current code of jqGrid I can see many small problems identivied by ReSharper. It&#39;s mostly the following:</p>
<ul>
<li>declared, but not used parameters in the function. It&#39;s very common problem in the usage of <strong>$.each</strong> or in the event handlers. For example, <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.base.js#L1977" target="_blank">the line</a></li>
<li>value assigned, but not used in any execution path. For example <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.base.js#L2660" target="_blank">the line</a>.</li>
<li>declaration of variable in the function with the same name as in the outer scope. For example, declaration <strong>i</strong> variable which can be easy renamed in <strong>j</strong> or <strong>k</strong> to fix the problem.</li>
<li>the usage of variables which start with capical character, undescore (_) or the usage of undescore inside of the name.</li>
<li>usage of possibly unassigned value.</li>
<li>...</li>
</ul>
<p>Description of all the small problems which are not really errors can get many time, but I could make the most clear and transparent changes (for example the first and the second problems from the list above) for beginning and post the results as a pull request. What do you think about?</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sun, 15 Jan 2012 23:22:06 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small improvements of the jqGrid code with respect of ReSharper 6</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24259</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24259</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Just do these fixes in GitHub. Thanks again. Going to look at the others.</p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Sun, 14 Aug 2011 11:30:57 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on small improvements of the jqGrid code with respect of ReSharper 6</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24175</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24175</guid>
        	        	<description><![CDATA[<p>It&#39;s just an reminder. You promissed to read my suggestions. ReSharper could help to remove unused parameters used in callback functions in defferent places of jqGrid. It point additionally to some places where uninitialized variables could be used. All this is not clitical, but can improve the code.</p>
<p>Please read <a href="/blog/?page_id=393/bugs/jqgrid-width-not-adjusted-in-showcolhidecol-in-case-of-shrinktofit-false/#p24098" target="_blank">another bug report</a> too which I resently posted.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 06 Aug 2011 18:34:24 +0300</pubDate>
        </item>
        <item>
        	<title>tony on small improvements of the jqGrid code with respect of ReSharper 6</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24080</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24080</guid>
        	        	<description><![CDATA[<p>Thanks Oleg,</p>
<p>I will check these at end of week. Will let you know</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 28 Jul 2011 12:41:12 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on small improvements of the jqGrid code with respect of ReSharper 6</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24074</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-improvements-of-the-jqgrid-code-with-respect-of-resharper-6#p24074</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>The new version of ReSharper (<a href="http://www.jetbrains.com/resharper/" target="_blank">http://www.jetbrains.com/resharper/</a>) gives many hints which halps to improve a litle JavaScript code of jqGrid. If you have an interest I could post you the recomendations one after another or you can buy the tool yourself.</p>
<p>Here is example of recommendation about grid.grouping.js:</p>
<p>1) the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L77" target="_blank">line 77</a>&#160;is</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9992' value='Select Code' data-codeid='sfcode9992' /></p>
<div class='sfcode' id='sfcode9992'>$.each(grp.summaryval[0][itm],function(i,n) {</div>
<p>which can be reduced to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2983' value='Select Code' data-codeid='sfcode2983' /></p>
<div class='sfcode' id='sfcode2983'>$.each(grp.summaryval[0][itm],function() {</div>
<p>because <strong>i</strong> and <strong>n</strong> parameters will be never used.</p>
<p>2) In the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L100" target="_blank">line 100</a> the variable <strong>collapsed</strong> are initialized to <strong>false</strong>, so the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L130" target="_blank">line 130</a> with the same assignment can be removed.</p>
<p>3) In the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L141" target="_blank">line 141</a>&#160;the variable <strong>pmrtl</strong> will be initialized to&#160;"", but the value will be never used. Instead of that in the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L153" target="_blank">lines 153-154</a> the variable <strong>pmrtl</strong>&#160;will be set to <strong>grp.plusicon</strong> or <strong>grp.minusicon</strong> depend on <strong>grp.groupCollapse</strong>. One can for example remove the lines 153-154 and replace in the line 141 (initialization of <strong>pmrtl</strong>)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7864' value='Select Code' data-codeid='sfcode7864' /></p>
<div class='sfcode' id='sfcode7864'>pmrtl = &#34;&#34;</div>
<p>&#160;to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4007' value='Select Code' data-codeid='sfcode4007' /></p>
<div class='sfcode' id='sfcode4007'>pmrtl = grp.groupCollapse? grp.plusicon: grp.minusicon</div>
<p>4) The last parameter <strong>current</strong>&#160;of the function <strong>groupingGroupBy</strong>&#160;defined in the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L217" target="_blank">line 217</a> can be removed, because it will be never used inside.</p>
<p>5) Variable i will be defined in the &#160;function&#160;<strong>groupingGroupBy&#160;</strong>twice (in the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L226" target="_blank">line 226</a>&#160;and the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L232" target="_blank">line 232</a>). Die suggestion is to insert the declaration of <strong>i</strong>&#160;in the <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L219" target="_blank">line 219</a> or <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.grouping.js#L223" target="_blank">223</a>&#160;(which can be concatinated by the way) and renove "var " from the lines 226 and 232.</p>
<p>It is an example of advices which gives ReSharper. If you have an interest to make the corresponding changes in the jqGrid I could post you one after another advices to all other jqGrid modules.</p>
<p>Best regards<br />Oleg&#160;</p></p>
]]></description>
        	        	<pubDate>Thu, 28 Jul 2011 01:33:51 +0300</pubDate>
        </item>
</channel>
</rss>