sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
884 stars 209 forks source link

Displayed count of items per category is wrong for "Program and Libraries" if "Android Apps" has items #2232

Closed wladimirleite closed 1 week ago

wladimirleite commented 1 month ago

Just a minor detail that I noticed in the "Program and Libraries" category (maybe there are other cases).

If there are two categories A and B, A is B's parent, and both have items, then the item count displayed for A is wrong. I think that originally parent categories do not have any items assigned to them. So we may:

  1. Change the current configuration files and maybe put a constraint to avoid this situation (items assigned to categories that have child subcategories).
  2. Change the code used to count, so items in the parent category are also added to the total (which is a trivial change).

The second option seems better, unless I am missing some detail, as it may be desired in some cases to have items assigned to parent categories, so I am submitting a simple fix.

image

lfcnassif commented 1 month ago

Hi @wladimirleite!

Originally, parent categories shouldn't have items. When I implemented the category hierarchy, I thought about it and thought it would be more intuitive for users to always put items in leaf categories. Otherwise, it wouldn't be possible to display just items in the parent category simply selecting a node in the category tree.

Not sure when the "Android Apps" subcategory was created without creating a complementary "Other Apps" subcategory... Maybe we should go with option 1, not sure... Could you point an example when items in non leaf categories would be better?

wladimirleite commented 1 month ago

Not sure when the "Android Apps" subcategory was created without creating a complementary "Other Apps" subcategory...

That was added by @patrickdalla while reviewing the APK parser (commit https://github.com/sepinf-inc/IPED/pull/1956/commits/7527882f555d13a145e874c46c6f1c45290d092a), which I thought that made sense.

Could you point an example when items in non leaf categories would be better?

This was pretty much the case I had in mind, as the category "Program and Libraries" already mixes a lot of different types, it seems a bit odd to me have everything else under "Other Apps".

Maybe we should go with option 1, not sure...

Sure! We can simply remove "Android Apps" sub-category. I will close the PR I just submitted.

lfcnassif commented 1 month ago

This was pretty much the case I had in mind, as the category "Program and Libraries" already mixes a lot of different types, it seems a bit odd to me have everything else under "Other Apps".

I agree.

lfcnassif commented 1 week ago

Fixed by https://github.com/sepinf-inc/IPED/pull/2233