nexB / scancode.io

ScanCode.io is a server to script and automate software composition analysis pipelines with ScanPipe pipelines. This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ Google Summer of Code, nexB and others generous sponsors!
https://scancodeio.readthedocs.io
Apache License 2.0
95 stars 81 forks source link

It would be mighty useful if we could "group by" some value the rows in resources, packages, or dependencies lists #950

Open pombredanne opened 9 months ago

pombredanne commented 9 months ago

It would be mighty useful if we could "group by" resources, packages, dependenecies or other lists by one of the displayed attribute values such as for instance to group by extension, or by license expression or tag or something else.

I am not sure what would be the best UI treatment of this though in general I like to think of these as some sort of "facets".

In all cases I would like to be able to see at least one of these on demand (or one for each of all attributes and always shown?) and when I click on one of the values, I want the list to be filtered to show only these values.

We could also refine to enable multi value selection.

sujalshah-bit commented 9 months ago

I am newbie to this project and i just setup installation on my local system, can i work on this issue ( begginer friendly ? ) if yes then kindly guide to me the resources that would be very helpful . thanks

pombredanne commented 9 months ago

I am newbie to this project and i just setup installation on my local system, can i work on this issue ( begginer friendly ? ) if yes then kindly guide to me the resources that would be very helpful .

@sujalshah-bit Welcome! I am not sure this is super beginner friendly as a first issue, but you are welcomed to take a pass at it.

Say you have a project with 5 .txt files and 5 .java files and 6 .class files. I would first start with a python function to craft a proper queryset that groups by the resources by extension as a first baby step. And have a few tests for this.

Then next would be to work on the UI side. There needs to be a button to trigger the grouping in the UI based on one of the displayed fields.... may be a drop down listing field names and called "group by:", then if a field is selected, you will need to display by group which implies also sorting and being able to collapse (initial state) and expand a group. The exact UI treatment of this is TBD, and there is likely some widget in Bulma for this.

pombredanne commented 9 months ago

@tdruez I checked out the latest code and this looks very promising. Some comments:

tdruez commented 9 months ago

@pombredanne Thanks! What about the displayed list of resources, do you want to keep the table approach? Any ideas to simplifies this?

pombredanne commented 9 months ago

@pombredanne Thanks! What about the displayed list of resources, do you want to keep the table approach? Any ideas to simplifies this?

One approach could be this:

tdruez commented 9 months ago

@pombredanne One concern is how to display values such as the following one, on a left pane, in a readable way: (gpl-2.0 AND (bsd-simplified OR gpl-2.0) AND gpl-1.0-plus) AND other-copyleft AND bsd-new AND (gpl-2.0 AND bsd-new) AND gpl-2.0-plus AND wtfpl-2.0 AND mit

pombredanne commented 9 months ago

You could use a ... ellipsis and make it a fixed length string as in: (gpl-2.0 AND (bsd-simplified OR gpl-2.0) AND gpl-1.0-plus) AND ...