Sorting

Sorting in Klassco

By default, Klassco displays results in the order they were found, without any sorting.

However, you can easily sort the output in ascending or descending order. This guide will show you how, building on what you learned in Composable Flags [↗].


Examples

Sort from lowest to highest duplication:

$ klassco --asc

Sort from highest to lowest duplication:

$ klassco --desc

Sorting can be useful when narrowing down your search. For instance, to find the file with the least amount of duplicated combo classes, use:

$ klassco -s --asc -d 1 src

To find the class combo that's least duplicated across all files in the src folder, use:

$ klassco -s -g --asc -d 1 src

conclusion

Klassco allows you to easily sort your final output. This feature is particularly useful when working on large codebases and determining which parts to prioritize for refactoring.

For more examples of creative uses of these features, please refer to the references in the Next Steps section.


Next steps