Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code analysis issues #21

Open
16 tasks
juanis2112 opened this issue Sep 22, 2020 · 4 comments · May be fixed by spyder-ide/spyder#20683
Open
16 tasks

Code analysis issues #21

juanis2112 opened this issue Sep 22, 2020 · 4 comments · May be fixed by spyder-ide/spyder#20683
Labels
ready-for-implementation Changes decided during UX study

Comments

@juanis2112
Copy link
Contributor

juanis2112 commented Sep 22, 2020

  • Add Save and Load
  • Remove expand/collapse section from hamburger menu and context menu
  • Remove expand/collapse all from hamburger menu
  • Change “History” to “History results” in the hamburger menu and dialog title.
  • History option in hamburger menu will redirect to preferences instead of specialised dialog
  • Replace description in dialog “Choose how many results you want to store in the history results, pick a number between 1-100)
  • Remove the browse file icon
  • If you close the file, the code analysis will be closed (BUT STORED IN HISTORY) and switched to the current file (load the analysis if it was ran before, load the “empty state pane” in case the analysis was not ran before for that)
  • When a code analysis result is loaded from the combobox and the file is not open, this will open the file automatically.
  • Move Run Code analysis under “Run”in the toolbar.
  • Feedback for empty pane (Move here the message Source code has not been rated yet…)
  • When loading previous results open the file corresponding to the analysis. (Show error message if the file was deleted)
  • Embed content of warnings in code analysis and have some options to decide which linter to use. (Pylint (Non Real time) VS Real time)
  • Deactivate run analysis button when real time analysis is selected
  • Remove "Save file before analyzing it" option
  • Remove "Results are stored here"
@ccordoba12
Copy link
Member

I have some suggestions to improve the UI of entries for the code analysis results:

imagen

  1. Remove arrows on the left. They don't add anything of value to the results.
  2. Move error code and name to the end and make them appear in italics.
  3. Move line number to be at the beginning, remove line and show it in bold.

In other words, I'd like to see something like this for each entry (this is the first one in my screenshot):

138: TODO: Once we can test that all plugins can be restarted - W0511 (fixme)

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 28, 2023

Some additional things to take into account:

  1. Code analysis is able to receive a directory to analyze all Python files in it and shows the results of each one in the tree. That makes the code quite complicated and it's not easily discoverable, so we should remove it.
  2. The roots of the tree (i.e. Convention, Refactor, etc) should be un-collapsed by default after an analysis finishes. That way all results would be immediately visible to users without any additional effort.
  3. When the results of real code analysis are integrated in this pane, we should remove the submenu Source > Show warning/error list. It'd make make little sense to keep that menu when this functionality is available.
  4. Perhaps we should change the order of the tree roots to be Error, Warning, Convention, Refactor. That way we'd show them in order of importance from top to bottom.

@ccordoba12
Copy link
Member

ccordoba12 commented May 8, 2023

@CAM-Gerlach has some additional suggestions about this which we discussed in our previous UX meeting and I agreed with them.

So, I'd suggest work on this issue should be halted until he post those suggestions.

@CAM-Gerlach
Copy link
Member

Sorry, I'd taken a look at this before, but then it fell off my radar during the craziness of PyCon and my post-PyCon mental health break and subsequent catching up with everything I'd missed.

After talking once again with @ccordoba12 , here's our current consensus for now:

  • We should replace the current file selection combobox + browse button in the Code Analysis for selecting files with a dropdown identical to the "Search in" dropdown from Find pane, which is simpler, more functional and more consistant. This would have the "File" option selected by default, which would run pylint on the currently selected file (like how the pane currently works by default, and also how that option works in the Find pane. Likewise, it would include the same Project and Working directory options to run pylint on those directories, as well as Select custom directory, Clear this list and a list of the ~10 or 20 most recent selected directories.

    Screenshot

    image

  • The treeview dropdowns should start uncollapsed by default, down to the individual messages (including when running pylint on a directory), so users can see them more easily. However, if possible, Spyder should persist the (un)collapsed state of the top-level dropdowns between runs and when switching files rather than resetting it to open, and ideally also persist the state of the per-file downdowns (at least between consecutive runs on the same directory). This need not, however, persist between Spyder sessions (i.e. get saved to preferences).

    Screenshot

    image

  • To make it faster, more discoverable and more consistent to quickly collapse or uncollapse everything depending on the user's needs, we the uncollapse all and collapse all buttons should be moved from items in the hamburger menu to buttons on the second row of the toolbar, to the left of the "view output" button, using the same icons these buttons as in the Outline pane toolbar.

    Screenshot

    image

  • Additionally, the "collapse section" and "uncollapse section" items are not terribly useful on their own and mostly redundant, so they should just be removed.

    Screenshot

    image

  • Modify the message text order to put the line number first in bold, then error name in italics with the code in parenthesis (instead of the opposite currently), and finally the message, eg.:

    Line 128 unused-variable (W0612): Unused variable 'plugin_class'

  • Consequent with that, change the sort order of the messages to sort on line number first, then error code, instead of the other way around, to match the line number being moved first and to be generally more useful

  • Remove the arrow, as highlighted in @ccordoba12 's post above

  • Change order to Error, Warning, Refactor, Convention (i.e. reverse the current order) to be in decreasing order of priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-implementation Changes decided during UX study
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants