Code Inspection not working

Answered

Hello everybody,

my problem is the following: When I am executing the code inspection PyCharm just says "No suspicious code found", even when I add errors intentionally. I am running PyCharm under Linux (Linux Mint 19) and already tried to reset all configurations and use a new clean project, but this didn't solve the problem. On my second machine it is working under Windows (same Project, synchronization using Git). Does somebody have an idea how to fix it?

Thanks in advance!

4 comments

Hi,

Please try File | Invalidate Caches / Restart..., if doesn't help try to delete the system sub-directory (https://intellij-support.jetbrains.com/hc/articles/206544519) and then start PyCharm again.

If nothing helps, please upload your idea.log (Help | Show Log in...) to https://uploads.services.jetbrains.com/ zipped and let me know the name of that zip file.

0

Invalidating the cache or removing the named directory didn't help.

The log file repeatedly contains the following message:

2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - PyCharm 2018.2.4  Build #PY-182.4505.26 
2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - JDK: 1.8.0_152-release
2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - VM: OpenJDK 64-Bit Server VM
2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - Vendor: JetBrains s.r.o
2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - OS: Linux
2018-11-01 15:15:03,912 [ 553561]  ERROR - ex.GlobalInspectionContextImpl - Last Action: InspectCode
2018-11-01 15:15:03,936 [ 553585]   INFO - ex.GlobalInspectionContextImpl - Code inspection finished. Took 782ms
2018-11-01 15:15:04,500 [ 554149]  ERROR - aemon.impl.PassExecutorService - one.util.streamex.StreamEx.nonNull()Lone/util/streamex/StreamEx;
java.lang.NoSuchMethodError: one.util.streamex.StreamEx.nonNull()Lone/util/streamex/StreamEx;
    at com.jetbrains.python.psi.PyUtil.filterTopPriorityResults(PyUtil.java:591)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.resolveModuleAt(PyResolveImportUtil.kt:160)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.a(PyResolveImportUtil.kt:361)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.access$resolveInRoot(PyResolveImportUtil.kt:1)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil$resultsFromRoots$visitor$1.visitRoot(PyResolveImportUtil.kt:312)
    at com.jetbrains.python.psi.resolve.RootVisitorHost.visitSdkRoots(RootVisitorHost.java:99)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.c(PyResolveImportUtil.kt:342)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.a(PyResolveImportUtil.kt:105)
    at com.jetbrains.python.psi.resolve.PyResolveImportUtil.resolveQualifiedName(PyResolveImportUtil.kt:75)
    at com.jetbrains.python.psi.impl.PyBuiltinCache.a(PyBuiltinCache.java:153)
    at com.jetbrains.python.psi.impl.PyBuiltinCache.getBuiltinsForSdk(PyBuiltinCache.java:137)
    at com.jetbrains.python.psi.resolve.PythonSdkPathCache.getBuiltins(PythonSdkPathCache.java:113)
    at com.jetbrains.python.psi.impl.PyBuiltinCache.getInstance(PyBuiltinCache.java:85)
    at com.jetbrains.python.psi.resolve.QualifiedNameFinder.a(QualifiedNameFinder.java:189)
    at com.jetbrains.python.psi.resolve.QualifiedNameFinder.b(QualifiedNameFinder.java:181)
    at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140)
    at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
    at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
    at com.jetbrains.python.psi.resolve.QualifiedNameFinder.getQualifiedName(QualifiedNameFinder.java:180)
    at com.jetbrains.python.psi.impl.PyClassImpl.getQualifiedName(PyClassImpl.java:257)
    at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassTypes(PyClassImpl.java:1332)
    at com.jetbrains.python.psi.types.PyClassTypeImpl.getSuperClassTypes(PyClassTypeImpl.java:125)
    at com.jetbrains.python.psi.impl.PyClassImpl.a(PyClassImpl.java:425)
    at com.jetbrains.python.psi.impl.PyClassImpl.b(PyClassImpl.java:1636)
    at com.jetbrains.python.psi.impl.PyClassImpl.e(PyClassImpl.java:1434)
    at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:819)
    at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:797)
    at com.jetbrains.python.psi.impl.PyClassImpl.f(PyClassImpl.java:1430)
    at com.jetbrains.python.psi.impl.PyClassImpl.getAncestorTypes(PyClassImpl.java:1425)
    at com.jetbrains.extensions.python.PyClassExtKt.inherits(PyClassExt.kt:28)
    at com.jetbrains.python.testing.PythonUnitTestUtil.isTestClass(PythonUnitTestUtil.java:97)
    at com.jetbrains.python.testing.PyTestsSharedKt.isTestElement(PyTestsShared.kt:120)
    at com.jetbrains.python.testing.PyTestLineMarkerContributor.getInfo(PyTestLineMarkerContributor.kt:27)
    at com.intellij.execution.lineMarker.RunLineMarkerProvider.getLineMarkerInfo(RunLineMarkerProvider.java:46)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:174)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:96)
    at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:80)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:91)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:423)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1161)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:416)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:580)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:415)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:391)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:147)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:222)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:389)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:161)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
0

Thanks!
The NoSuchMethodError usually appears when you unzip new version over the previous one. It seems that something was not quite right with PyCharm during that.

ERROR - aemon.impl.PassExecutorService - one.util.streamex.StreamEx.nonNull()Lone/util/streamex/StreamEx; 
java.lang.NoSuchMethodError: one.util.streamex.StreamEx.nonNull()Lone/util/streamex/StreamEx;

All in all, I kindly ask you to reinstall PyCharm into an empty directory. So, completely uninstall it, download from https://www.jetbrains.com/pycharm/download and install. Please let me know if the problem remains.

1

Yes, that solved the problem! Thanks!

0

Please sign in to leave a comment.