Static Code Analysis can be attempted without selected file
See original GitHub issueIssue 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
(orpip
, if not using Anaconda) -
Could not reproduce insidejupyter 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?
- Delete pylint.results in spyder-py3, start spyder, run a Static Code Analysis on a file
- rename, move or delete the file (which should be the only one listed in the path dropdown)
- open an existing .py file in spyder.
- restart spyder. The path field in the analysis tab is now cleared but the Analyse Button is now active
- 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:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for clarifying!
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