History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25354
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Quincy L. Acklen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

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

Created: 18 Mar 08 17:02   Updated: 04 Apr 08 11:29
Component/s: Code Analysis. Inspection, Editor. Error Highlighting, Editor. Intention Actions, HTML.Editing
Fix Version/s: Diana 8243, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: windows xp

Build: 7,744
Fixed in build: 8,242
Severity: Medium


 Description  « Hide
IDEA shows warning "unused function declaration" for inline functions. This bug was marked resolved (IDEADEV-23553), 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(){}



 All   Comments   Work Log   Change History      Sort Order:
Quincy L. Acklen - 03 Apr 08 17:24
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 - 03 Apr 08 17:29
You need to take IDEA 7.0.4 eap

Quincy L. Acklen - 03 Apr 08 17:31
sorry i just noticed that the release notes were for 7782 not 7757

Quincy L. Acklen - 03 Apr 08 17:56
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 - 03 Apr 08 18:20
Maybe, Help -> About reports exactly the build used.
Nonlocal symbols (top level functions / variables) are not checked for usability

Quincy L. Acklen - 04 Apr 08 01:08
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 - 04 Apr 08 11:29
In fact the inspection name is 'Unused Java Script Local Symbols'