Method return value is never used - not flagged

I've marked Method return value is never used as "Show Error" but following code doesn't get flagged


CryptoUtility.Xor(userBuffer, saltBuffer);


What it does do is give me a suggest to "Iterate collection via foreach"

Anything else I need to do?


2 comments

Hello Paul,

This inspection works on method return value, in declaration. Like:

bool DoSomething(int x) {...}

If no code actually checks return value when calling DoSomething(..), then
bool will be flagged as redundand.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> I've marked Method return value is never used as "Show Error" but
IR> following code doesn't get flagged
IR>
IR> CryptoUtility
IR>
IR> Xor(userBuffer, saltBuffer)
IR>
IR> What it does do is give me a suggest to "Iterate collection via
IR> foreach"
IR>
IR> Anything else I need to do?
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5238491#5238491


0

Is there nothing to tell you if you are ignoring the result of a function - we've been bitten about 3 times this week by this.

I can see it might be tricky for framework code, but I thought I could put an attribute on the function where the result needs to be used.

0

Please sign in to leave a comment.