This is a migrated thread and some comments may be shown as answers.

Tons of false errors

23 Answers 254 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel Billingsley
Top achievements
Rank 1
Daniel Billingsley asked on 28 May 2010, 10:21 PM
I have a fairly complex project that VS compiles without hitch - there are only two warnings in the entire project according to VS.

I turn on JustCode and I now have 171 JC errors.  Since I now have bold annoying red squigglies all over, I now have to ignore them altogether or turn JustCode off.

I'm choosing to leave it off.  The only thing I've really found useful was the formatting, which it does very well.

23 Answers, 1 is accepted

Sort by
0
Dennis :: Dr. Code
Telerik team
answered on 02 Jun 2010, 10:12 AM
Hi Daniel Billingsley,

Sorry to hear that. Which version are you using? Q1 or Q1 SP? We are fixing such false positives with high priority, so each new version gets better in that respect. We'll release the first test version of Q2 soon, which will have more issues fixed. It's possible that your issues are already fixed as well.

Of course you could also give us some info about the false positives you are seeing. So we could make sure they are fixed for Q2. Sometimes a very small issue (e.g. JC not beeing able to find a particular type) can cause a lot of errors to be shown. Thanks for your help.


Kind regards,
Dennis :: Dr. Code
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Billingsley
Top achievements
Rank 1
answered on 02 Jun 2010, 01:29 PM
Q1 SP.

I've already uninstalled the product, because it activates every time I open VS.  I'll try again in a couple quarters when it maybe is working better.

I didn't spend a lot of time investigating the errors, as it was obviously so far out of control it wasn't going to be useful.  But I do remember in the code that many of the marked errors where indeed JC apparently not finding the type.
0
Hans Kratz
Telerik team
answered on 08 Jun 2010, 07:29 PM
Hello Daniel Billingsley,

 sorry to hear that you had to uninstall JustCode.

We will release a beta version of the next release later this week. Maybe you could give it a spin and tell us if it works better for you? We are very interested in fixing those kinds of issues so your feedback would be greatly appreciated.

Regards,
Hans Kratz
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
mark leavesley
Top achievements
Rank 1
answered on 15 Jun 2010, 09:11 AM
Hello,

I also have a lot of false errors. Our project is quite large and used by clients round the world, there are no errors in VS but JC reports 502! Nearly all of them are this:

VisualBasic.Net: Unknown method 'DBVarCharName()' of 'blah'

The source line is:

strr_NEW_COLUMN_DATA_TYPE(0) = DB.DBVarCharName() & "(145)"

With the empty parenthesis underlined in red.

If I right click on DBVarCharName and choose 'Just Navigate' and 'Go to definition' it jumps right to it! 

How can it be an unknown method if it can navigate to it? The method definition is:

Public Overloads ReadOnly Property DBVarCharName() As String

Regards,
Mark Leavesley
0
mark leavesley
Top achievements
Rank 1
answered on 15 Jun 2010, 09:12 AM
PS I'm using the latest beta, 2010.1.610.1
0
Hans Kratz
Telerik team
answered on 17 Jun 2010, 10:57 AM
Hi Mark,

I tried to reproduce the issue with the information you provided but failed. This is some of the code I tried:

Module Module1
    Sub Main()
        Dim foo As String
        Dim obj As X
        foo = obj.DBVarCharName() & "(145)"
    End Sub
End Module
 
Class X
    Inherits Y
    Public Overrides ReadOnly Property DBVarCharName() As String
        Get
            Return Nothing
        End Get
    End Property
End Class
 
Public Class Y
    Public Overridable ReadOnly Property DBVarCharName() As String
        Get
            Return Nothing
        End Get
    End Property
End Class

This code does not produce any false errors here but of course it is just a small experiment. In order to investigate the issue we need more information or (at best) a small testcase with which we can reproduce this problem.

As Dennis said before, we are very interested in fixing issue like that and adding code which previously produced such issues to our regression suite. So please help us figuring this out.

Best wishes,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
mark leavesley
Top achievements
Rank 1
answered on 17 Jun 2010, 11:22 AM
Hello,

We will create a test solution for you, but might be a day or two.


Regards,
Mark Leavesley
0
mark leavesley
Top achievements
Rank 1
answered on 17 Jun 2010, 01:06 PM
In the course of creating the test solution and comparing it to our real code I worked out the problem, below the modified solution:

Module Module2 
  Sub Main() 
    Dim foo As String 
    Dim obj As X = Nothing 
    foo = obj.DBVarCharName() & "(145)" 
  End Sub 
End Module 
 
Class X 
  Inherits Y 
End Class 
 
Public Class Y 
  Public Overridable ReadOnly Property DBVarCharName() As String 
    Get 
      Return Nothing 
    End Get 
  End Property 
 
  Public Overridable ReadOnly Property DBVarCharName(ByVal bar As IntegerAs String 
    Get 
      Return Nothing 
    End Get 
  End Property 
End Class 

Attached is the error it generates. Hope this helps.


Regards,
Mark Leavesley


0
mark leavesley
Top achievements
Rank 1
answered on 17 Jun 2010, 02:55 PM
Looking through the other errors JC has reported...it's quite illuminating:

    For i = 1 To D709B_PLANNING_SALES_PERIOD_COMPARISON_COUNT() 
      If i > 1 Then : strl_SQL = strl_SQL & "," : End If 
      strl_SQL = strl_SQL & " str_selected" & i 
    Next 
 

Produces " Missing 'Next' " (see attachment) , "There is no applicable member or variable '[Next]'", "Unexpected end of block" and "Unexpected end of statement", twice.

Whereas:
      strl_SQL = strl_SQL & "                           ) AS drv_insert  
 

Rightfully produces an error "Missing line break", though I would suggest it's a bit misleading as the line break is not missing, it's the closing quote. Alarmingly, not only does VS not produce an error, the code actually runs and works as intended.

I also have a number of errors about using comparison operators with strings, i.e:

If string1 > string2 then

Unconventional maybe, but not actually an error?

The flip side to the error I reported earlier is that I have several "Several methods are applicable to ...", but it's not true!


Regards,
Mark Leavesley
0
Hans Kratz
Telerik team
answered on 18 Jun 2010, 08:10 AM
Hello Mark,

thanks a lot for your thorough investigation of those issues. I was able to reproduce all of them here with the information you provided and added them as four distinct bug reports to our issue tracker so you will be notified automatically once they are taken care of. We are dedicated to fixing them for the Q2 release or for the Q2 Service Pack 1 at the latest. 

Thanks again for those most excellent reports. Since many of the VB language features (e.g. the support for unterminated string literals) are undocumented we rely on publicly available sourcecode and user feedback like yours to improve our VB support. If you encounter any other problems like this please report.

I have awarded you Telerik points for your effort.


 Greetings,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
mark leavesley
Top achievements
Rank 1
answered on 18 Jun 2010, 08:18 AM
Hello,

Thanks for that.

You mean the lack of errors about the missing quote is intentional?!

We have often noticed that VS2008 doesn't flag missing keywords but when you edit the line the missing word is inserted. Are these behaviours listed anywhere?

Regards,
Mark Leavesley
0
Hans Kratz
Telerik team
answered on 18 Jun 2010, 08:49 AM
Hi Mark,

well, one would expect that the language specification describes what is accepted by the compiler and what is not. Of course there are always bugs in language specifications and in compilers.

The VB.net language specification for VB.net 9 can be found here:
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=39de1dd0-f775-40bf-a191-09f5a95ef500&displayLang=en

Section 2.4.4 talks about string literals. There is nothing in there which suggests that an unterminated string literal like this are allowed. Still as you said the VB.net compiler compiles it just fine. So it is an undocumented feature/bug in the VB.net compiler.

We will change JustCode to accept unterminated string literals (since the VB.net compiler accepts them too) but emit a warning for them (since it is ugly to have them and not backed by the VB spec).

Greetings,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Matthew
Top achievements
Rank 1
answered on 29 Sep 2010, 11:18 PM
With X initialized to Nothing, I think the error is correct.  There wouldn't be a compile time error, but it will fail at runtime.
0
Hans Kratz
Telerik team
answered on 05 Oct 2010, 03:40 PM
Hello Matthew,

I think all the issues (good code marked as erroneous by JustCode) that Mark raised in this thread have been fixed. Can you elaborate on which problem you are referring to?

Regards,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David Brown
Top achievements
Rank 2
answered on 13 Oct 2010, 06:04 PM
Hi all,

I, too, am experiencing a lot of false positives - 132 errors in 70 files.  All are: ASP.Net tags: File does not belong to a project.  The file referenced is a Master file.  VS 2010 lists no errors.  Specifically,

<%@ page language="vb" autoeventwireup="false" masterpagefile="~/Templates/MasterPage.Master" codebehind="WebPage.aspx.vb" inherits="WebPage" %>
<%@ mastertype virtualpath="~/Templates/MasterPage.Master" %>

In both lines, JustCode (2010.3.1004.1) identifies "~/Templates/MasterPage.Master" as a file not belonging to the project.

Thanks,
David

 
0
Daniel Billingsley
Top achievements
Rank 1
answered on 13 Oct 2010, 07:45 PM
Please don't take this the wrong way....

but there are some things that Telerik has done really well, and some that make me just scratch my head.

CodeRush and ReSharper are both such great products, I have to wonder about the wisdom of spending your resources playing "catch up" there vs. adding features in areas where you are leading the industry.  The way you'll keep me as a customer isn't by making another code tool that works almost as good as the competition - it's by making the products I couldn't find at the competition when I ended up with Telerik even better than what they're writing to keep up with you.
0
Hans Kratz
Telerik team
answered on 24 Oct 2010, 06:29 PM
Hi David!

It would be great if you could help us tracking down this issue. This is a website, right? Do you open it from the local filesystem, local IIS or remote IIS?

 
All the best,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Hans Kratz
Telerik team
answered on 24 Oct 2010, 06:36 PM
Hello Daniel,

I think we have quite a bit to offer with JustCode. It is true that we we have to catch up in quite a few areas but there are other areas where the competition has to catch up (e.g. JavaScript support, solution checking speed, ...).

Of course false errors are very annoying which is why fixing them is one of our top priorities. For example the issues Mark reported were all fixed AFAIK. In order to fix them however we need a way to reproduce the problem, e.g. code snippets when sufficient, information about the solution setup or ideally a test solution which exhibits the problem. It would be really great if you could help us make JustCode better.

Best wishes,
Hans Kratz
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andreas Kaech
Top achievements
Rank 1
answered on 13 Nov 2010, 12:44 PM
Hi Telerik,
I'm testing JC and see a few advantages over the competitors.
But, look to the attachment. There is a strange JustCode-Error in a third-party js-file (simile-ajax-bundle.js).
I'm curious what's the reason.
Thanks,
Andreas
0
mark leavesley
Top achievements
Rank 1
answered on 15 Nov 2010, 09:55 AM
I think JC is interpreting your hex sequence as a character rather than a literal. What happens if you do  "\u00" + "22";?

Regards,
Mark Leavesley
0
Hans Kratz
Telerik team
answered on 18 Nov 2010, 12:43 PM
Hi Andreas,

Thanks for pointing this out. JustCode does not interpret this unicode character sequence correctly. I have added this problem to our issue tracker and it will be fixed in one of the next releases. Until then you can tell JustCode to ignore the error by pressing Alt-Enter on the error and choosing 'Ignore this Error / Warning'

 

Best wishes,
Hans Kratz
the Telerik team
See What's New in JustCode in Q3 2010 on Thursday, November 18, 2010 11:00 AM - 12:00 PM EST: Register here>>
0
Chris
Top achievements
Rank 1
answered on 23 Nov 2010, 08:19 PM
Since people seem to be using this thread to report false positives, I'll add one. I just started trying out JustCode today, and so far I like it. :) I found this problem in an Outlook 2007 Add-in project (using VSTO, which is what you get if you create a new project under Office > 2007).

The false positives are on Outlook., and anything derived from it.

I've got Microsoft.Office.Interop.Outlook imported as part of the project (which is done automatically in this type of project). I suspect the issue JustCode is having is around this user namespace import: Outlook = Microsoft.Office.Interop.Outlook

I've included some code that illustrates the problem, but you can make it appear by simply creating a new Outlook 2007 add-in and doing "dim asdf as Outlook.Mailitem= nothing"

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button1.Click
       Dim mail As Outlook.MailItem = Nothing
           Dim inspector As Outlook.Inspector = CType(Context, Outlook.Inspector)
 
           mail = TryCast(inspector.CurrentItem, Outlook.MailItem)
           If mail Is Nothing Then
               ' didn't work
               Throw New Exception("Outlook Mail Item could not be created.")
 
           End If
   End Sub
0
Hans Kratz
Telerik team
answered on 26 Nov 2010, 05:47 PM
Hello Chris,

thanks a lot for the feedback. It was quite easily reproducible. The problem is that JustCode does not properly pick up the project-level aliased namespace import Outlook = Microsoft.Office.Interop.Outlook. So as a workaround you can just add the following at the beginning of the file and JustCode should show no errors anymore.

Imports Outlook = Microsoft.Office.Interop.Outlook

I marked this for fixing in the Q3 Service Pack.

Kind regards,
Hans Kratz
the Telerik team
Browse the videos here>> to help you get started with JustCode
Tags
Code Analysis
Asked by
Daniel Billingsley
Top achievements
Rank 1
Answers by
Dennis :: Dr. Code
Telerik team
Daniel Billingsley
Top achievements
Rank 1
Hans Kratz
Telerik team
mark leavesley
Top achievements
Rank 1
Matthew
Top achievements
Rank 1
David Brown
Top achievements
Rank 2
Andreas Kaech
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or