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

Add bug path length column to Bug overview #1209

Merged
merged 1 commit into from
Jan 10, 2018

Conversation

csordasmarton
Copy link
Contributor

@csordasmarton csordasmarton commented Dec 4, 2017

Closes #1160

Add bug path length column to Bug overview table to indicate how long the report path is.

Screenshot:
cc_bug_path_length

@@ -156,7 +157,8 @@ struct ReportData {
9: i64 column, // column number of the report main section (not part of the path).
10: Severity severity, // Checker severity.
11: ReviewData reviewData, // Bug review status information.
12: DetectionStatus detectionStatus // State of the bug (see the enum constant values).
12: DetectionStatus detectionStatus, // State of the bug (see the enum constant values).
13: i64 bugPathLength, // Length of the bug path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the policy on commas after the last item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add a new item to this type, we don't have to modify the last item to place a comma at the end.


reportData.bugPathLength = {
length : reportData.bugPathLength,
max : maxBugPathLength
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the max here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set a background color for each bug path length. We calculate this background color by using this maximum value (maximum length will be red). For more information see: generateRedGreenGradientColor in util.js.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do we need this inside all report? Or no better place to put this? Also, this is the max on the displayed page or max in the run? In case the former, I wonder if that is the behavior the users are expecting.

@whisperity whisperity added the RDY-OnHold 🛑 Patch reviewed and ready, but don't merge due to having to merge a dependent patch first. label Dec 5, 2017
@whisperity
Copy link
Contributor

@csordasmarton Migration script is merged.

@whisperity whisperity removed the RDY-OnHold 🛑 Patch reviewed and ready, but don't merge due to having to merge a dependent patch first. label Dec 7, 2017
@@ -248,6 +270,7 @@ function (declare, dom, Deferred, ObjectStore, Store, QueryResults, topic,
{ name : 'Message', field : 'checkerMsg', width : '100%', formatter : checkerMessageFormatter },
{ name : 'Checker name', field : 'checkerId', width : '50%', formatter: checkerNameFormatter },
{ name : 'Severity', field : 'severity', cellClasses : 'severity', width : '15%', formatter : severityFormatter },
{ name : 'Bug path length', field : 'bugPathLength', cellClasses : 'bug-path-length', width : '15%', formatter : bugPathLengthFormatter },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should find a shorter name for this column. Isn't Length enough? When the header for the column is longer than the value printed, something's not quite right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Difficulty is much better. What do you think @whisperity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

@whisperity
Copy link
Contributor

I think making the gradient happen from min to max is a problem, as min, max and average are very very sensitive to a single outlier.

Consider this example for bug path lenghts on three projects. That 42 length in Postgres makes that one the only really red one, and BPLs of 30-ish will be ever so slightly yellow, even though they are considerably less prominent in the code than short ones. Perhaps using an interquartile-range based approach is better?

boxplot

ecdf

@dkrupp
Copy link
Member

dkrupp commented Dec 8, 2017

Coloring should not depend on the actual result list. I suggest using a color scale that uniformly shows longer (impossible to understand) bug paths as reddish and more easily shorter ones as light greenish. You could for example say that you limit the bug path color range between [1,50] (being 50 and above impossible to understand) going gradually from light green to dark red.

@csordasmarton csordasmarton force-pushed the bug_path_length branch 2 times, most recently from 63087b5 to 52589bf Compare December 11, 2017 10:30
@bruntib
Copy link
Contributor

bruntib commented Jan 3, 2018

Is it really required to introduce a new column? Isn't it efficient enough to use the max(order) from the corresponding bug path table?

Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the column to Length or "Path Length" instead of difficulty. Otherwise fine.

@@ -248,6 +265,7 @@ function (declare, dom, Deferred, ObjectStore, Store, QueryResults, topic,
{ name : 'Message', field : 'checkerMsg', width : '100%', formatter : checkerMessageFormatter },
{ name : 'Checker name', field : 'checkerId', width : '50%', formatter: checkerNameFormatter },
{ name : 'Severity', field : 'severity', cellClasses : 'severity', width : '15%', formatter : severityFormatter },
{ name : 'Difficulty', field : 'bugPathLength', cellClasses : 'bug-path-length', width : '15%', formatter : bugPathLengthFormatter },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name it simply to Length or Bug Path length as it correctly expresses what the number means. "Difficulty" is not expressive enough

Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase API version, since the thrift API has been updated

@@ -68,7 +68,8 @@ enum SortType {
CHECKER_NAME,
SEVERITY,
REVIEW_STATUS,
DETECTION_STATUS
DETECTION_STATUS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API version needs to be incremented?

@csordasmarton csordasmarton added the WIP 💣 Work In Progress label Jan 8, 2018
Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After Daniel's comments are resolved it LGTM!

@@ -68,7 +68,8 @@ enum SortType {
CHECKER_NAME,
SEVERITY,
REVIEW_STATUS,
DETECTION_STATUS
DETECTION_STATUS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the comment about "comma after last item" hold here? That would reduce the number of line changes in enums/structs too, assuming it's not a syntax error.

Add bug path length column to `Bug overview` table to indicate how long the
report path is.
Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants