Closed tmonck closed 1 year ago
Hey @tmonck , thanks for checking out this action! Yes the code complexity definitely sounds interesting. I don't have much experience with calculating this sort of metric myself but I will look into it.
I can look into it as well. I do know there is the complexity attribute in the xml just like branch and coverage, at least with the cobertura format.
@tmonck awesome! As I see it, as a starting point, complexity feature could be included just for the cobertura format. We can have complexity set to 0 for opencover, and in that case, if complexity is 0 we can just not show it =) Later it can be expanded by calculating the complexity manually, parsing through classes/methods/branches of a coverage file Where do you think it would fit to be displayed? In the comment, in the action summary, both?
if you have some ideas feel free to open a PR. When PR is created you can see how the comment and summary will look, since action is self-running on the repo
I was thinking it's worth being in the table on the summary, but wanted to gauge with you as well. I'll gladly take a stab at it and open a PR.
sounds good!
Here is a quick preview of what I had in mind. The number in the parenthesis is the complexity for the Project and then I included it for each file.
I'm thinking about adding the ability to hide it and setting it true by default since opencover won't be supported out of the gate.
So I added support for opencover really quick. Do you think having the ability to hide the complexity would be desired by your consumers of this action? As of now in the PR I opened I have not hidden it even when it's equals 0 in value.
@tmonck sorry, had to merge your PR into another branch and then open a PR into main. Github Actions have issues with using github token when PR is opened using forked repository https://github.com/actions/first-interaction/issues/10 Complexity looks perfect https://github.com/bibipkins/dotnet-test-reporter/actions/runs/5085103838#summary-13771267094
No worries at all. I found that same issue after you comment on the PR. Only thing missing in case you want it added was the hiding of complexity when it was 0.
@tmonck it works for both coverage types so its fine. If you have anything else to add to this feature feel free to reopen the issue. Thank you for your contribution!
I was looking into a few different GHA that do test reporting. I like the output of this one the most but found it lacking the parsing/printing of the Code Complexity that is in some of the test output formats. Is this a feature you would be interested in supporting?