Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Fix similar code checking in codeclimate #108

Merged
merged 3 commits into from
Feb 24, 2021
Merged

Conversation

LiKang6688
Copy link
Contributor

similar-code threshold describes the mass code block to be analyzed for duplication.
Refer https://github.com/codeclimate/codeclimate-duplication
for this settings.

@@ -1,4 +1,11 @@
version: "2"
plugins:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be under plugin? Does it work putting it under checks, as the other settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the Configuring in https://github.com/codeclimate/codeclimate-duplication, it needs to be under plugin. We can use Code Climate CLI (https://github.com/codeclimate/codeclimate) to do analyze locally to see if it works as we want.

@haxxmaxx
Copy link
Collaborator

I just tried this rule on this branch #109. With the threshold at 3 it does not complain about styling-utils, which I think is a bit too weak. Those two functions could be replaced with one function taking one extra argument, which is something I think code climate should catch, but then you also get the false positives, like the propTypes.

.codeclimate.yml Outdated
config:
languages:
filters:
- "(object (Identifier PropTypes))"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be really nice if this works, but I still see 6 fixed issues on codeclimate, there should only be the two propTypes that are fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, look into it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it is correct

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but if you look at codeclimate it is saying that the propTypes duplications are fixed, then there are two new issues that are exactly the same... We can try to merge this and see what it looks like when ir runs on main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@LiKang6688 LiKang6688 merged commit 25687c9 into main Feb 24, 2021
@LiKang6688 LiKang6688 deleted the gqq/Code-Climate-Config branch February 24, 2021 09:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants