question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Static Code Analysis can be attempted without selected file

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Static code analysis can be attempted when no file is selected and causes an internal error.

What steps reproduce the problem?

  1. Delete pylint.results in spyder-py3, start spyder, run a Static Code Analysis on a file
  2. rename, move or delete the file (which should be the only one listed in the path dropdown)
  3. open an existing .py file in spyder.
  4. restart spyder. The path field in the analysis tab is now cleared but the Analyse Button is now active
  5. click it

What is the expected output? What do you see instead?

The button should not be active. Clicking it should have no effect

Paste Traceback/Error Below (if applicable)

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/__main__.py", line 7, in <module>
    pylint.run_pylint()
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/__init__.py", line 19, in run_pylint
    Run(sys.argv[1:])
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/lint.py", line 1394, in __init__
    linter.check(args)
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/lint.py", line 801, in check
    self._do_check(files_or_modules)
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/lint.py", line 920, in _do_check
    for descr in self.expand_files(files_or_modules):
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/lint.py", line 959, in expand_files
    self.add_message(key, args=message)
  File "/home/leo/.local/lib/python3.6/site-packages/pylint/utils.py", line 449, in add_message
    self.stats['by_module'][self.current_name][msg_cat] += 1
KeyError: None

Versions

  • Spyder version: 3.3.3
  • Python version: 3.6.8
  • Qt version: -
  • PyQt version: -
  • Operating System name/version: Fedora 28 64-Bit

Dependencies

IPython >=4.0     :  6.4.0 (OK)
cython >=0.21     :  None (NOK)
jedi >=0.9.0      :  0.12.1 (OK)
matplotlib >=2.0.0:  2.2.3 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  1.14.5 (OK)
pandas >=0.13.1   :  0.22.0 (OK)
psutil >=0.3      :  5.4.3 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pyflakes >=0.6.0  :  1.6.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.7.5 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
rope >=0.9.4      :  0.11.0 (OK)
sphinx >=0.6.6    :  1.7.5 (OK)
sympy >=0.7.3     :  None (NOK)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
CAM-Gerlachcommented, Feb 26, 2019

Thanks for clarifying!

1reaction
definite-purplecommented, Feb 26, 2019

No. I’m referring to the static code analysis tab, which has a file select dropdown entry field thing, and I meant that no file path is shown in there. At least one code file (after step one potentially a new untitled one) is always open int the editor pane when reproducing the error

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is Static Code Analysis? Static Analysis Overview
Static analysis is a method of debugging that is done by automatically examining the source code without having to execute the program. This ......
Read more >
Why you should use client-side static code analysis for your ...
Static code analysis is like having another person review your code. Most developers won't check code in until it's been reviewed by a...
Read more >
Resolving Prescan Warnings and Errors - Veracode Docs
During a static scan, you may receive warning or error messages about the uploaded files. Use the tips from Veracode to resolve these...
Read more >
Making VS Static Analysis Tools Work for You (Not Annoy You)
You can tell VS to run Code Analysis automatically during your builds, by right-clicking on your project, and changing the settings under –...
Read more >
Static Code Analysis for Python - Towards Data Science
Static code analysis looks at the code without executing it. It is usually extremely fast to execute, requires little effort to add to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found