How to find weak warnings?

Hi,

Sometimes it happens that a code file (js, php etc.) seems to be error/warning free, no indicators are shown in the scrollbar but the Analysis popup says otherwise. And the Analysis popup is empty too, no hints where it found the error/warning, Does someone know how to track down the error/warning? Is this a bug?

My guess is that this is somehow related to inspection settings, but still I think that it should show some hint, right?

To make things more clear I've made a screenshot, as can be seen on there are no hints where the error/warning is found.

PhpStorm PS-142.5282 on Windows 10 Pro x64 with JDK 1.8.

Analysis.png

20 comments
Comment actions Permalink

I had the same problem. I just did an invalidate caches and restart and the weak error went away.

2
Comment actions Permalink

Hi there,

Please use "Code | Inspect Code..." to see detailed output.

no indicators are shown in the scrollbar

Indicators are just styling elements -- it's possible that your color schema does not have one for weak warnings (just a thought).

Another possible explanation -- analysis is "ghosting" from previous run. Using the aforementioned action will reset it.

1
Comment actions Permalink

I have the same problem.

PhpStorm 10 build 143.381

if I mouse over the square indicator it says 2 weak warnings
if I run inspect code it says No suspicious code found

Thanks for support.

1
Comment actions Permalink

Hi, to make it even more clear I've made 2 screenshots after running the "Inspect Code..." on the current file.

No-suspicious-code-found-1.png shows that it found no suspicious code:
No-suspicious-code-found-1.png

No-suspicious-code-found-2.png shows that there is one weak warning:
No-suspicious-code-found-2.png

This makes me think that suspicious code and weak warnings are unrelated, is that true?

Are "Code Inspection" and Analysis 2 different parts (things)?

Is it not so easy (impossible?) to find the weak warning?

1
Comment actions Permalink

That dual screenshot was very helpful, @CornelisBrouwers. Yes, @DavidF has the workaround, File | Invalidate Caches/Restart..

It's been a chronic (if minor) annoyance getting this contradictory condition daily for months in PyCharm Pro 2016.2.3. I tend to have several windows open for days. Restarting PyCharm may fix it (even without invalidating caches) but it always comes back eventually. Today I had this in the Analysis popup:

     "31 weak warnings found"

yet F2 says:

     "No errors found in this file"

PyCharm is denying me that encouraging feeling that only comes from the green checkmark.

1
Comment actions Permalink

Hi, I would suggest to share any info you can provide in a related bug report: https://youtrack.jetbrains.com/issue/PY-17682

This would possibly help our devs to nail down the root cause of the issue.

1
Comment actions Permalink

Another (faster) workaround may be to "Select All -> Cut -> Paste" instead of having to restart the IDE.

Works for me as it re-triggers the code analyis and removes any incorrect warnings.

1
Comment actions Permalink

Had the same issue in PyCharm. Solved it without a restart by using the following steps:

File > Invalidate Caches / Restart > Just Invalidate > Close file > Open file

1
Comment actions Permalink

Error colors are set in Preferences | Editor | Colors & Fonts | General, correct?

The "Error stripe mark" checkbox and color refer to the indicator in the scroll bar, right?

0
Comment actions Permalink

Sorry, no ideas then.

Whenever I see such stuff in PHP files the "Inspect Code..." works for me (at least always did in the past). You seems to have this issue with JS code -- not sure how and why different IDE behavior could be here.

Can you create standalone code sample (with all required dependencies in it) that would reproduce such behavior in brand new project?

This makes me think that suspicious code and weak warnings are unrelated, is that true?

Are "Code Inspection" and Analysis 2 different parts (things)?

As far as I'm aware:

  • there is parser/lexer on the bottom that checks that code is OK from language point of view and if not shows errors (red code). Such errors cannot be suppressed and it's not done as Inspections (although for reporting (code review?) purposes they may be showing as separate entries in Inspect Code results -- depends on actual implementation. This one should produce errors only.
  • then you have (optional) Inspections on the top (optional because you can disable or suppress them). They can produce any kind of results -- warnings/weak warnings/typos etc (plus, you can change severity manually).
0
Comment actions Permalink

In IntelliJ IDEA 2016.1.2  I had to

right click | Analyze | Inspect Code...

IntelliJ IDEA 2016.1.2
Build #IU-145.972, built on May 14, 2016
JRE: 1.8.0_76-release-b162 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

0
Comment actions Permalink

Still happens daily for me in JavaScript using PyCharm 2017.1.3. (May be fixed in Python?)

@dimitry.tronin that bug report has been marked "obsolete" without explanation. So it cannot be voted upon.

I'm all but giving up on youtrack, or at least the JetBrains implementation that dogfoods it (which is otherwise admirable by the way).  Duplicates are assiduously marked, but bugs languish for years. None of my reports or comments or votes or stars have ever led to a fix as far as I can tell.

0
Comment actions Permalink

Just close the file and open it again!

Worked for me...

0
Comment actions Permalink

@Bob Stein, yeah, I'm also a bit surprised this bug got closed without explanation.

What file types gives you the behavior described? JS/py? Issue might be caused by additional inspection settings or code-analysis tools (smth similar to ESlint or php code sniffer).

0
Comment actions Permalink

Yes, @dimitry.tronin I have gotten this error with both Python and JavaScript files recently. (I thought it had stopped in Python but it's happened twice since then.)  At the moment I have ... 25 weak warnings that aren't really there on the JS file I'm working on. None on the PY.

And yes @Mohammad Amin Chitgarha, close & open clears it.

Still can't reproduce on cue.  Takes about an hour of editing for it to crop up.

0
Comment actions Permalink

Happened today in PyCharm 2017.2.1 in a python file:  a false-positive typo indication in upper right corner (green squiggle). F2 reports no errors.

0
Comment actions Permalink

Try going to File->Invalidate Caches \ Restart -> Invalidate and restart. This fixed things for me once it reloaded. 

 

 

0
Comment actions Permalink

@DelHyman-Jones that has been suggested by @DavidF and a similar one by @YorgosV, above. It does make the problem go away but it's hardly a fix. As this condition appears dozens of times a day for me, I would rank the workarounds, from most-to-least painful:

4. Invalidate Caches and Restart.

3. Invalidate Caches, close and reopen file.

2. Close and reopen file.

1. Ignore the Analysis icon and hit F2 (Next Highlighted Error) every time you want to know if there are any REAL errors or warnings in the file.

0

Please sign in to leave a comment.