Inspection UI Feedback (As of build 7241)

Just thought I was ping EAP list about Inspection UI. I'm wondering if any more progress is
planned for Selena?

The most pressing seems to be:
(1) The Editor error tooltip's "more..." link to error description needs improvement.
http://www.jetbrains.net/jira/browse/IDEA-13997

(2) Code->QuickFix/Cleanup Code
http://www.jetbrains.net/jira/browse/IDEADEV-17781

But there were still lots of open issues documented in my older thread:
Inspection UI Feedback (As of build 6951)
http://www.intellij.net/forums/thread.jspa?threadID=267328


I have a couple more thoughts I will post next, including my experience with the
new 'Fix all X issues in a file' intention

16 comments
Comment actions Permalink

I have been using the 'Fix all X issues in a file' intention quite often. This
is a very helpful addition.

Before this, whenever I was working on a file and wanted to apply quickfixes all
over a file, I would hit ALTSHIFTI which runs Inspect Code on the current
file. Then I would look over the inspection results. To apply a quickfix to
all items of a particular error, you click the error name and then click the
quickfix icon to apply the fix to all items.

Now instead with this 'Fix all X issues in a file' intention, I can click on
the line of code, press ALT+ENTER, RIGHT_ARROW, DOWN_ARROW, ENTER on 'Fix all
X issues in file' which is very fast because it is all keyboard.

This got me thinking, why does this 'Fix all X issues in a file' feel so much
pleasurable than hitting ALTSHIFTI to run inspect code on the current file?

One reason is that the ALT+ENTER intention allows you to apply the fix within
the context of the code. Whereas running Inspect Code forces you to look at a
totally different presentation in the Inspection Results tree.

The inspection results tree is more more complex because it can have up to 8
levels in the tree. By default, the tree is only opened up to the Error
Category Level, so you need to open the tree up many levels to get to the
actual problems.

Here is an example of the Inspection Results Tree.
Abstraction issues -->-->Collection declared by class, not interface -->-->-->Core -->-->-->-->com.xyz.apps.admin -->-->-->-->-->ServiceAddSubServicesPanel -->-->-->-->-->-->mSelectedChildGroups -->-->-->-->-->-->-->Declaration of Vector should probably be weakened to 'List' -->-->-->-->-->-->mSelectedParentGroups -->-->-->-->-->-->-->Declaration of Vector should probably be weakened to 'List' -->-->"Magic number" -->-->-->Core -->-->-->-->com.xyz.apps.admin -->-->-->-->ServiceAddSubServicesPanel -->-->-->-->-->initGUI() -->-->-->-->-->-->Magic number 200 -->-->-->-->-->-->Magic number 250 -->-->-->-->-->-->Magic number 200 -->-->-->-->-->-->Magic number 250 -->-->-->-->-->-->Magic number 200 -->-->-->-->-->-->Magic number 250 -->-->-->-->-->-->Magic number 200 -->-->-->-->-->-->Magic number 250 -->-->-->-->-->-->Magic number 50 -->-->-->-->-->-->actionPerformed(ActionEvent) ]]>

Wouldn't it much nicer if IDEA could present the inspection results in just 2
or 3 levels at most?

For example, if you eliminate the Project Level, the Error Category Level, the
Module Name Level, the Package Name Level, and the Class Name Level, and Method
name level. (If the results span multiple classes/files, then you might want
to keep the Class Name/File Name level).

Here is the flattened tree version:

mSelectedChildGroups -->-->Declaration of Vector should probably be weakened to 'List' -->mSelectedParentGroups -->-->Declaration of Vector should probably be weakened to 'List' "Magic number" -->Magic number 200 -->Magic number 250 -->Magic number 200 -->Magic number 250 -->Magic number 200 -->Magic number 250 -->Magic number 200 -->Magic number 250 -->Magic number 50 ]]>

Hallelujah!! This tree is much easier to work with, and if the first level is
expanded by default, you would be able to immediately select the Error name, e.g.
'Scope Too Broad' and apply the quickfix without having to expand any more tree
nodes.

0
Comment actions Permalink

Here is a summary of what I was suggesting:

Inspection Results
-



(1)
By default, only the Error Name Level, the Class Name/File Name Level, and the
Inspection Result/LOC Leel should be displayed. If the scope is the CurrentFile,
then the Class Name/File Name Level could be collapsed also.

This means that the Project Level, Error Category Level, Module Name Level, Package
Name Level, and Method Name Level should not be displayed by default. Most of these
add very little information. The user already knows the scope of the analysis; What
they are interested in is the actual results, not 8 levels of categorization!!

IDEA already has a 'Group by directory' toolbar icon which turns off the Module level,
but the other levels currently have no option to collapse them. There is a
'Group by Severity' toolbar which adds yet another level.

If you wanted to get fancy with the UI, and also avoid the Inspection Results toolbar
from becoming cluttered, then I recommend having a single toolbar button called 'tree levels'
which pops up a dialog which shows a prototypical tree with a checkbox at each level.
The user can then visually see where each level is and decide to turn it on/off. This is
more intuitive then to have 8 different buttons labeled 'Group by X', 'Group by Y', etc.

For example,

[X] Project -->--> [X] Error Category -->-->--> [X] Error Name -->-->-->--> [X] Module -->-->-->-->-->--> [X] Package -->-->-->-->-->-->--> [X] Class/File -->-->-->-->-->-->-->--> [X] Method/Field -->-->-->-->-->-->-->-->--> [X] Error/Warning/Info Result Item ]]>

I put on each level in example, but the Error Name, and Result Item levels
shouldn't be disabled.

(2)
I would like the Inspection Results tree to highlight the inspections which have a
quickfix available. Maybe this could be done simply by giving option to sort A..Z
or by QFAvailable,A..Z

I noticed in 7241 that the 'Mr. Inspection' icon is used as the folder node for the Error
Name level. How about showing two different icons for 'inspection with quickfix' and
'inspection without quickfix'. It would be more user friendly if you can tell just by
looking at the inspections if the quickfix is supported. Currently, you have to select the
node and see if the quickfix icon becomes enabled.

0
Comment actions Permalink

I forget to mention that I still would love to filter the inspections in the Settings->Errors panel, so you can see which ones are new in the release. Ideally, each inspection should be tagged with which release it was introduced and then you could select from a filter 'Release >= " to filter them. The description for the inspection could say which release it was added. Also, if an inspection offers additional configuration options, that would be nice to know it was updated in a release.

I think the inspections are a very important part of IDEA and you really need to raise the visibility of new and improved inspections, because they don't stand out like other new features unless and until you encounter them in the Editor.

And for existing users who have locked their profile (like me), I never discover these new inspections, unless I go and hunt for them in the Errors dialog, which gets tiresome with each release.

I had some additional discussion about this under section "Settings - Errors - Inspection Profile Management" in my old thread.

I think I also mentioned I would like to see only inspections that have quickfixes. This would be esp. helpful if Jetbrains implements the Code->Quickfix/Cleanup Code feature I suggested. (http://www.jetbrains.net/jira/browse/IDEA-12825)

These changes would not only improve usability of the Error settings dialog, but I think would get users more excited about inspections if they can see, for example, that "Wow! All of these inspections have quickfixes!" or "Wow! Look at all these inspections added in 7.0!" Currently, I get a mixed feeling looking at the Errors dialog because this information is hidden from me. Now, with each release, I'm curious about what new inspections have been added but also I have a feeling of dread -- dread of having to spend literally hours to look through 100s of inspections, trying to find these new or updated inspections within the ever-growing catalog tree of inspections

0
Comment actions Permalink

+1 I've also been trying to hunt down those new inspections

0
Comment actions Permalink

+1 too , i'd like to be able to find quickly new inspections, or updated ones...

0
Comment actions Permalink

+1 There's enough to do already without hunting for new inspections...

0
Comment actions Permalink

+10 I wholeheartedly agree. One of the major sweetnesses of the IDE and
they're hidden away in obscurity...

N.

Dave Lorde wrote:

+1 There's enough to do already without hunting for new inspections...

0
Comment actions Permalink

As an experiment I have added the text "New in 7" to the descriptions of all InspectionGadgets inspections introduced in Selena. Type 7 in the filter of the Errors dialog will show all new inspections in InspectionGadgets (and the "Magic Number" inspections:-)
Please find it in the next EAP build and let me know how you like it.

Bas

0
Comment actions Permalink

Bas,

Thanks! It works great!
(See attached if you want to see the filtered set of inspections.)

I noticed too that it shows the "Magic Number" inspections even if I search for "in 7" or "New in 7". Is that a bug in the search box implementation?

In addition to new inspections, you could also have a convention to put "Updated in 7" if any inspections supported additional options or significant change in behavior.

Also, could you also put the words "Quickfix Available" for every inspection which supports a quickfix? That would address the other related issue I had.

That would be all I would need, although I still believe the UI should offer such filter options overtly, because users might not figure out the search method.

0
Comment actions Permalink

I forgot to attach screenshot.



Attachment(s):
7269_new_in_7_inspections.png
0
Comment actions Permalink

It would also be nice to tag global inspection as "Global Inspections".

Currently, in Errors Settings dialog, there is a toolbar icon 'Show|Hide Global Inspections' but there is no way to show only the global inspections, which is what I want to do. Also in the tree, it says in light grey text "(available for Analyze|Inspect Code)" at the end of name of each global inspection, but the search box doesn't match on that text. I suppose if the search box was fixed so I could earch for "available for Analyze|Inspect Code", then that would do the job also.

For my own configuration, I have a profile "Recommended" which is my default Editor error profile, and I have another "RecommendPlusGlobal" which I use when I run Analyze->Inspect Code if I want more thorough (and time consuming) analysis.

0
Comment actions Permalink

I have filed Jira requests for the above items:

Inspection Results Tree should allow collapsing each level of the tree, not just the Severity and Directory level.
http://www.jetbrains.net/jira/browse/IDEA-14815

Inspection Results Tree should distinguish 'Quickfix Available' erorrs from others.
http://www.jetbrains.net/jira/browse/IDEA-14816

0
Comment actions Permalink

It shows the "Magic Number" inspection because it always performs an "or" search. I believe this is a bug, it should only do an "or" search if an "and" search did not find anything. I will submit a bug report about that.

An "Updated in 7" list is too much effort for little gain in my opinion. Almost all inspection source files have had some modification done on them in the Selena development time frame. It will cost a lot of effort to locate those changes which were "significant". Furthermore, I am unsure what the definition of a significant change is. If an inspection was changed to run twice as fast, but has no other visible changes in behavior, is that a significant change for example?

Quickfix available and global inspection notifications do sound useful, I will try to put them in. Note again, that those will only be available for InspectionGadgets inspections.

Bas

0
Comment actions Permalink

It shows the "Magic Number" inspection because it always
performs an "or" search. I believe this is a bug, it should
only do an "or" search if an "and" search did not find
anything. I will submit a bug report about that.


I agree, the expectation is implicit AND by default, although
I would also like the option to quote a literal string e.g.
"New in 7" which is matched as a single term. I left comments
on your bug IDEA-14855.

An "Updated in 7" list is too much effort for little gain in my
opinion. Almost all inspection source files have had some
modification done on them in the Selena development time frame.
It will cost a lot of effort to locate those changes which were
"significant". Furthermore, I am unsure what the definition of
a significant change is. If an inspection was changed to run
twice as fast, but has no other visible changes in behavior, is
that a significant change for example?


Ok, I understand. I was mainly thinking of cases where a new option
was added in the inspection's configuration, because sometimes I find I
like an inspection but it is unusable due to some limitation, e.g.
false positivies, lack of a quickfix, etc. So, I would definately
want to know if an old inspection now has a quickfix or some new
configuration option.

If it was worthwhile enough to enhance the existing inspection, it
is definately worthwhile to advertise the fact.

I can give you an example right now. This new inspection "Type
may be weakened" is unusable for me because it is telling me
that I should change a bunch of objects to type
"java.lang.Object", which is usually not desired. Now if it stays
like this for IDEA 7.0, then I won't use it, but if sometime later
it is enhanced to give some configuraiton as to what to check on
(parameters, fields, local variables,etc.) and some types to avoid
like java.lang.Object, java.awt.Component, etc. then I would want
to know it has these options because then I might use it.

Quickfix available and global inspection notifications do sound
useful, I will try to put them in. Note again, that those will
only be available for InspectionGadgets inspections.


Oh man, I didn't realize that this was only for InpsectionGadgets
inspections. So, right now when I search for "New in 7" I am not
seeing any of Jetbrains inspections or any Inspections-JS javascript
inspections?

If that is the case, we still need Jetbrains to provide a complete
solution.

0
Comment actions Permalink

+
Oh man, I didn't realize that this was only for InpsectionGadgets
inspections. So, right now when I search for "New in 7" I am not
seeing any of Jetbrains inspections or any Inspections-JS javascript
inspections?+

Inspection-JS didn't get any new inspections in 7, to the best of my knowlege. The Spring/Hibernate/TestNG/Groovy inspections are all new in 7, each are in their own plugins.

--Dave Griffith

0

Please sign in to leave a comment.