Code analysis gives false positives

Issue #1197 resolved
Toni Garcia-Die created an issue

I have installed IlluminatedCloud version 2.0.4.8. The very same problem does not seems to happen with version 2.0.4.3.

Code analysis gives false positives on old lines in newly modified pages, not in the modified lines but in old existing lines. For instance:

background-image: url({!backgroundUrl}); }

reports under backgroundUrl: Cannot resolve file 'backgroundUrl}' and this field exists in the controller.

Or the following line:

<apex:outputText value="{!SUBSTITUTE($Label.SchedulingLockedBookingStatus, '{0}', booking.Status__c)}"/>

reports under the comma at the end of the label name: ')' or '.' expected, got ','

But as you know, SUBSTITUTE gets three parameters. The last time this line was modified was June this year.

All the code works fine in the server.

Comments (4)

  1. Scott Wells repo owner

    Thanks for filing. I believe this is a side-effect of another regression fix I implemented recently where {!...} expressions in string literals were not being processed properly. With that bug fixed, I believe the surrounding IDE's logic may be finding other issues where it expects the evaluated type of that expression to match the XSD data type of the enclosing XML attribute. I'll take a look...likely I just need to suppress the inspections at this cross-language boundary.

  2. Scott Wells repo owner

    Hi, Toni. I tried to reproduce this unsuccessfully. I have the following VF page:

    <apex:page id="TestControllerPage" controller="TestController">
        <style>
            .div {
                background-image: url({!testString});
            }
        </style>
        <apex:outputText value="{!SUBSTITUTE($Label.addCommentLabel, '{0}', opp.StageName)}"/>
    </apex:page>
    

    and I'm not seeing any code inspection errors. It's very possible that I have a different set of code inspections enabled/disabled than you, and to be specific, it's possible that I've disabled the specific inspection(s) that you're seeing.

    Would you mind confirming that what I've included above should raise the issue. Assuming so, would you please get the exact name of the code inspection(s) that are being presented? The easiest way to do this is to place the caret on the text that is flagged as incorrect, then type Alt+Enter (Windows/Linux) or Opt+Enter (Mac) to bring up the code intentions. Press Cursor-Right to show more options and choose Edit inspection profile setting. That should open the Inspections config screen focused on the exact code inspection. Either grab a screenshot of that or just jot down the inspection group/name and send that to me. I will then verify that I have enabled the same code inspection(s) and hopefully will be able to reproduce the issue.

    Thanks!

  3. Scott Wells repo owner

    I just uploaded 2.0.4.9 which includes a few small fixes that may help here, but my guess is that they won't. Do you mind updating just to verify one way or the other? Assuming the problem still exists, could you send the requested code inspection details so I can make sure I'm configured the same way? Thanks!

  4. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  5. Log in to comment