Comments (1)
Those two classes are being identified as "similar" code because they're structurally identical. Exactly the same structure, just different literal values/field names. mower
wasn't picked up as also duplication because its structure is slightly different, e.g. its ability fields had 3 keys.
If you don't find similar code identification useful in general, you can turn it off: https://docs.codeclimate.com/docs/disabling-individual-checks. If you're using codeclimate.com and not relying on the CLI, you can also mark those issues as "wontfix": https://docs.codeclimate.com/docs/issues#section-issue-statuses.
In this particular case I think your code is probably ok as-is, but having an inheritance chain where each subclass needs to overwrite that many fields also might be a smell indicating that the composition over inheritance principle might lead to a structure you'd be happier with.
from codeclimate-duplication.
Related Issues (20)
- Allow setting separate language specific mass thresholds for identical and similar code HOT 8
- Python 3 as default HOT 1
- unknown command engines:enable HOT 2
- How can I add exceptions for code patterns ? HOT 3
- Cannot exclude test files from duplication checks HOT 6
- Allow excluding specific lines (such as strict_types declaration in PHP).
- Doc - Default values for similar-code and identical-code
- Python type annotations cause analysis to fail HOT 1
- disable, enable, ignore-next pragmas HOT 2
- Wrong duplication detection on function overrides?
- Wrong reference to duplication error
- Configuration clearity
- Complex-number literals raise JSON error in Python
- Import statements in golang should be ignored HOT 1
- engine duplication failed with status 137 HOT 1
- some excluded fingerprints are being ignored
- Hash value ommission from Ruby-3.1 HOT 2
- CC::Parser::Client::HTTPError reported on certain files
- `Racc::ParseError` on argument forwarding with `(...)`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeclimate-duplication.