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

Also include amount of changed files to the calculation to show complexity of pr instead of size only #69

Open
HerrDerb opened this issue Apr 12, 2024 · 2 comments

Comments

@HerrDerb
Copy link

HerrDerb commented Apr 12, 2024

Currently the size of a PR is determined by the amount of changes (Deletion+ Modification)

In my perception, I take on on a PR which has 120 changes in a single file much easier, as on a PR which has 120 changes across 30 files. In other words, the complexity is more interesting as the size only.

By taking a file weight into account (1 file = x changes) the labels would effectively show the complexity of the pr.

@HerrDerb HerrDerb changed the title Also include amount of changed files to the calculation Also include amount of changed files to the calculation to show complexity instead of size only Apr 12, 2024
@johnlk
Copy link
Collaborator

johnlk commented Apr 13, 2024

That's an interesting concept. It might require a new parameter like "size_by_complexity: false" which is defaulted to false.

The complexity though is a bit subjective. Would you judge based on the lines added per file relative to the original files size? Or just the total number of files touched in general?

There are code complexity algorithms that a user might assume are being used if this param is enabled such as cognitive complexity which is used by CodeClimate.

@HerrDerb
Copy link
Author

Good thoughts. Well as you probably already have seen, I took a simple approach with the amounts of file being touched, as in my perception, it doesn't matter if there is 1 line change or 30 in a single file. What for me seems to increases the complexity is the context switch from file to file. Might be subjective though. I hear that you'd prefer to use the changed line/total line ratio?
Also the naming should be clear that is not about "code complexity" as it is not a static code analysis.

Disclaimer: I'm surly not that common with shell scripts :)

@HerrDerb HerrDerb changed the title Also include amount of changed files to the calculation to show complexity instead of size only Also include amount of changed files to the calculation to show complexity of pr instead of size only May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants