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

Comments

4 participants
@TraGicCode
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Aug 14, 2016

Member

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@TraGicCode

TraGicCode Aug 14, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Aug 14, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@danielpalme

danielpalme Aug 15, 2016

Contributor

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

Just let me know when you are done,

Contributor

danielpalme commented Aug 15, 2016

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

Just let me know when you are done,

@TraGicCode TraGicCode referenced this issue Aug 29, 2016

Merged

Crap Score Implementation #625

3 of 3 tasks complete
@TraGicCode

This comment has been minimized.

Show comment
Hide comment
@TraGicCode
Contributor

TraGicCode commented Aug 29, 2016

@danielpalme done.

@danielpalme

This comment has been minimized.

Show comment
Hide comment
@danielpalme

danielpalme Aug 29, 2016

Contributor

@TraGicCode
Great.

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TraGicCode

TraGicCode Aug 29, 2016

Contributor

is working for me and looks good!
👍

Contributor

TraGicCode commented Aug 29, 2016

is working for me and looks good!
👍

@TraGicCode

This comment has been minimized.

Show comment
Hide comment
@TraGicCode

TraGicCode Aug 30, 2016

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Aug 30, 2016

Member

I leave them pending so I can update the release notes

Member

sawilde commented Aug 30, 2016

I leave them pending so I can update the release notes

@TraGicCode

This comment has been minimized.

Show comment
Hide comment
@TraGicCode

TraGicCode Dec 28, 2016

Contributor

Any estimate on when the next release might be?

Contributor

TraGicCode commented Dec 28, 2016

Any estimate on when the next release might be?

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Dec 29, 2016

Member

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

Member

sawilde commented Dec 29, 2016

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

@akamud

This comment has been minimized.

Show comment
Hide comment
@akamud

akamud Aug 17, 2017

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

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

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Aug 19, 2017

Member

@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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@akamud

akamud Aug 19, 2017

I understand, no need to rush, I guess.

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 - Qn 2017 Aug 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment