Forum
01:33
10/08/2009
Hello Tony,
The new version of ReSharper (http://www.jetbrains.com/resharper/) 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.
Here is example of recommendation about grid.grouping.js:
1) the line 77 is
which can be reduced to
because i and n parameters will be never used.
2) In the line 100 the variable collapsed are initialized to false, so the line 130 with the same assignment can be removed.
3) In the line 141 the variable pmrtl will be initialized to "", but the value will be never used. Instead of that in the lines 153-154 the variable pmrtl will be set to grp.plusicon or grp.minusicon depend on grp.groupCollapse. One can for example remove the lines 153-154 and replace in the line 141 (initialization of pmrtl)
to
4) The last parameter current of the function groupingGroupBy defined in the line 217 can be removed, because it will be never used inside.
5) Variable i will be defined in the function groupingGroupBy twice (in the line 226 and the line 232). Die suggestion is to insert the declaration of i in the line 219 or 223 (which can be concatinated by the way) and renove "var " from the lines 226 and 232.
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.
Best regards
Oleg
12:41
Moderators
30/10/2007
Thanks Oleg,
I will check these at end of week. Will let you know
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:34
10/08/2009
It'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.
Please read another bug report too which I resently posted.
Best regards
Oleg
11:30
Moderators
30/10/2007
Hello Oleg,
Just do these fixes in GitHub. Thanks again. Going to look at the others.
Kind Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
23:22
10/08/2009
Hello Tony,
I use ReSharper 6.1 for my projects and find it'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's mostly the following:
- declared, but not used parameters in the function. It's very common problem in the usage of $.each or in the event handlers. For example, the line
- value assigned, but not used in any execution path. For example the line.
- declaration of variable in the function with the same name as in the outer scope. For example, declaration i variable which can be easy renamed in j or k to fix the problem.
- the usage of variables which start with capical character, undescore (_) or the usage of undescore inside of the name.
- usage of possibly unassigned value.
- ...
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?
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66