Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Maxim Mossienko 
Subsystem
Code Analysis. Inspection 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7744
Fixed in build
8242
Subsystems
0, 0, 0, 0
Severity
0
  • Submitted by   Quincy L. Acklen
    22 months ago (18 Mar 2008 17:02)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:58)
  • Jira: IDEA-43229
    (history, comments)

IDEA-43229

IDEA shows warning "unused function declaration" for inline functions in 7.0.3 build 7744 (re-open IDEADEV-23553)

0
IDEA shows warning "unused function declaration" for inline functions. This bug was marked resolved (IDEA-42099), but I still see the problem. I've included a more complete example with comments as well as a screen shot. This is inside a javascript file (bug.js)

function aaa(){

/ nested functions works as expected /
bbb();
function bbb(){}
ccc();
function ccc(){}

/ nested functions do NOT work as expected /
ddd();
eee();
function ddd(){} /// function ddd() appears unused because the function call eee() is between this function and it's caller
function eee(){} ///

/ nested functions do NOT work as expected /
fff();
ggg()
hhh();
iii(); // only the closest function call iii will show its function as used
function fff(){}
function ggg(){}
function hhh(){}
function iii(){} // only the closest function call iii will show its function as used


/ nested functions do NOT work as expected /
jjj();
kkk();
function jjj(){} // this function is shown as used only because a call to it appears below
function kkk(){}
kkk(); // after the fact function calls in between do not appear to be a factor
jjj(); // this causes function jjj() to appear as used
}

/ non-nested functions does NOT behave as expected /
function lll(){} // not used and not reported as such

/ non-nested functions behave as expected /
mmm();
nnn();
function mmm(){}
function nnn(){}

Environment: windows xp

Issue was resolved
Comments (7)
 
History (1)
 
Links
 
Quincy L. Acklen
  Quincy L. Acklen
03 Apr 2008 17:24
(22 months ago)
#permalink
It looks like this is marked as fixed in build 7757, but I still see the problem. I'm I just reading the change log incorrectly? All the same errors are present...
Maxim Mossienko
  Maxim Mossienko
03 Apr 2008 17:29
(22 months ago)
#permalink
You need to take IDEA 7.0.4 eap
Quincy L. Acklen
  Quincy L. Acklen
03 Apr 2008 17:31
(22 months ago)
#permalink
sorry i just noticed that the release notes were for 7782 not 7757
Quincy L. Acklen
  Quincy L. Acklen
03 Apr 2008 17:56
(22 months ago)
#permalink
7782 reports as IDEA 7.0.3 is that correct? I ask because while the utilized functions that are nested no longer report as unused, non-nested functions that are unused are not reported at all. (non-utilized nested functions are correctly reported). towards the bottom of the example function lll (that is LLL) is not utilized and it is not reported as such.
Maxim Mossienko
  Maxim Mossienko
03 Apr 2008 18:20
(22 months ago)
#permalink
Maybe, Help -> About reports exactly the build used.
Nonlocal symbols (top level functions / variables) are not checked for usability
Quincy L. Acklen
  Quincy L. Acklen
04 Apr 2008 01:08
(22 months ago)
#permalink
Wow, that is going to cause me to install and older build just to check it out. If nested functions just got fixed and top level functions never were checked, it's hard to imagine it every being a bug (as opposed to a very nice feature request).

I just can't believe that IDEA didn't used to report top level functions not used. I mean most people wouldn't want to nest anyhow (or even know that you can). Of the people that do know i think they tend towards prototyping javascript "objects".

I even recall a feature request to indicate unused/ureachable/unreferenced functions in the projects (the would be really cool but seems difficult). How would that have been suggested if top level functions aren't checked.

You've left me scratching my head. I'll check and report back.
Maxim Mossienko
  Maxim Mossienko
04 Apr 2008 11:29
(22 months ago)
#permalink
In fact the inspection name is 'Unused Java Script Local Symbols' :)