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

CRAP score feature #620

Closed
TraGicCode opened this issue Aug 13, 2016 · 14 comments
Closed

CRAP score feature #620

TraGicCode opened this issue Aug 13, 2016 · 14 comments

Comments

@TraGicCode
Copy link
Contributor

@TraGicCode TraGicCode commented Aug 13, 2016

Any thoughts on implementing the calculation of CRAP (Change Risk Anti-Patterns) metric? I think this would be helpful especially since the data needed for this calculation is already provided by Open Cover.

@sawilde
Copy link
Member

@sawilde sawilde commented Aug 14, 2016

Are you on about this metric?

crap(m) = comp(m)^2 * (1-cov(m)/100)^3 + comp(m)

Never thought of it; the comp(m) shown by OpenCover is actually at the IL level not source code.

What is it's value?

@TraGicCode
Copy link
Contributor Author

@TraGicCode TraGicCode commented Aug 14, 2016

The CRAP metric is a great metric to be used along with code coverage since.

Generally speaking, Crappy methods exhibit the following characteristics
1.) High Cyclomatic complexity
2.) Low code coverage

Its usually challenging to write tests for complex code. Therefore code without tests are signs of crappy code ( hence lack of code coverage ). Having some code coverage indicates some degree of thought about testability and implementation.

The value of this metric is to help mitigate/reduce risk by uncovering the possible presence of crappy code. The code can
1.) Have Tests added
2.) Be refactored ( preferable )

The common practices is a CRAP score of 30 or less is considered acceptable and generally anything higher should be looked at. This is really a team decision on this threshold.

@sawilde
Copy link
Member

@sawilde sawilde commented Aug 14, 2016

The common practices is a CRAP score of 30 or less is considered acceptable and generally anything higher should be looked at. This is really a team decision on this threshold.

Okay I can see how it can be useful - once done we'll need to work with @danielpalme to see if we can get a visualisation of this data in his awesome reporting tool.

@danielpalme
Copy link
Contributor

@danielpalme danielpalme commented Aug 15, 2016

I created an issue for ReportGenerator:
danielpalme/ReportGenerator#57

Just let me know when you are done,

@TraGicCode TraGicCode mentioned this issue Aug 29, 2016
3 of 3 tasks complete
@TraGicCode
Copy link
Contributor Author

@TraGicCode TraGicCode commented Aug 29, 2016

@danielpalme done.

@danielpalme
Copy link
Contributor

@danielpalme danielpalme commented Aug 29, 2016

@TraGicCode
Great.

You could try this beta release: https://www.nuget.org/packages/ReportGenerator/2.4.6-beta4
Does it work for you?

@TraGicCode
Copy link
Contributor Author

@TraGicCode TraGicCode commented Aug 29, 2016

is working for me and looks good!
👍

@TraGicCode
Copy link
Contributor Author

@TraGicCode TraGicCode commented Aug 30, 2016

What are the next steps taken in order for this to make it to the next release?

@sawilde sawilde closed this in #625 Aug 30, 2016
@sawilde sawilde reopened this Aug 30, 2016
@sawilde sawilde added this to the Release (Qn 2016) milestone Aug 30, 2016
@sawilde
Copy link
Member

@sawilde sawilde commented Aug 30, 2016

I leave them pending so I can update the release notes

@TraGicCode
Copy link
Contributor Author

@TraGicCode TraGicCode commented Dec 28, 2016

Any estimate on when the next release might be?

@sawilde
Copy link
Member

@sawilde sawilde commented Dec 29, 2016

nope - sorry - still waiting on the mono.cecil dependancy.

@sawilde sawilde modified the milestones: Release (Qn 2017), Release (Qn 2016) Apr 15, 2017
@sawilde sawilde closed this Apr 16, 2017
@akamud
Copy link

@akamud akamud commented Aug 17, 2017

Any update on this? I am using version OpenCover.4.6.519 but I guess this is not available yet.

@sawilde
Copy link
Member

@sawilde sawilde commented Aug 19, 2017

@akamud sorry not had a lot of time of late to work on a release - I've been waiting on another package but it seems to never want to release - I may look to make a beta release that uses the beta package I am dependant on but I am reluctant to create a release as of yet.

@akamud
Copy link

@akamud akamud commented Aug 19, 2017

I understand, no need to rush, I guess.

@sawilde sawilde moved this from Done to Inform of New Release in OpenCover - Q1 2019 Aug 19, 2017
@sawilde sawilde moved this from Inform of New Release to Done in OpenCover - Q1 2019 Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.