File card_list.js
has 803 lines of code (exceeds 250 allowed). Consider refactoring. Open
CardList = class CardList {
constructor(exclusions, edition) {
this.edition = edition
this.exclusions = exclusions
`` has 47 functions (exceeds 20 allowed). Consider refactoring. Open
CardList = class CardList {
constructor(exclusions, edition) {
this.edition = edition
this.exclusions = exclusions
Function dark_ages
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static dark_ages() {
return [
'PoorHouse',
'Beggar',
'Squire',
Function nocturne
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static nocturne() {
return [
'Druid',
'FaithfulHound',
'Guardian',
Function menagerie
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static menagerie() {
return [
'BlackCat',
'Sleigh',
'Supplies',
Function adventures
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static adventures() {
return [
'CoinOfTheRealm',
'Page',
'Peasant',
Function base2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static base2() {
return [
'Cellar',
'Chapel',
'Moat',
Function seaside
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static seaside() {
return [
'Embargo',
'Haven',
'Lighthouse',
Function hinterlands
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static hinterlands() {
return [
'Crossroads',
'Duchess',
'FoolsGold',
Function intrigue2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static intrigue2() {
return [
'Courtyard',
'Lurker',
'Pawn',
Function base1
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static base1() {
return [
'Cellar',
'Chapel',
'Moat',
Function prosperity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static prosperity() {
return [
'Loan',
'TradeRoute',
'Watchtower',
Function intrigue1
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static intrigue1() {
return [
'Courtyard',
'Pawn',
'SecretChamber',
Function renaissance
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static renaissance() {
return [
'BorderGuard',
'Ducat',
'Lackeys',
Function empires
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static empires() {
return [
'Engineer',
'CityQuarter',
'Overlord',
Function pull_set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
pull_set() {
let game_cards = _.sampleSize(this.cards, 10)
let aside_cards = _.filter(game_cards, (card_name) => {
return _.includes(CardList.aside_cards(this.exclusions, this.edition), card_name)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Similar blocks of code found in 4 locations. Consider refactoring. Open
static landmark_cards(exclusions = [], edition) {
let exclusions_for_edition = CardList.exclusions_for_edition(exclusions, edition)
return _.reduce(CardList.landmark_sets(edition), function(card_list, set) {
if (!_.includes(exclusions_for_edition, set)) {
if (_.includes(['base', 'intrigue'], set)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 142.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
static way_cards(exclusions = [], edition) {
let exclusions_for_edition = CardList.exclusions_for_edition(exclusions, edition)
return _.reduce(CardList.way_sets(edition), function(card_list, set) {
if (!_.includes(exclusions_for_edition, set)) {
if (_.includes(['base', 'intrigue'], set)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 142.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
static project_cards(exclusions = [], edition) {
let exclusions_for_edition = CardList.exclusions_for_edition(exclusions, edition)
return _.reduce(CardList.project_sets(edition), function(card_list, set) {
if (!_.includes(exclusions_for_edition, set)) {
if (_.includes(['base', 'intrigue'], set)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 142.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
static event_cards(exclusions = [], edition) {
let exclusions_for_edition = CardList.exclusions_for_edition(exclusions, edition)
return _.reduce(CardList.event_sets(edition), function(card_list, set) {
if (!_.includes(exclusions_for_edition, set)) {
if (_.includes(['base', 'intrigue'], set)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 142.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
let aside_cards = _.filter(game_cards, (card_name) => {
return _.includes(CardList.aside_cards(this.exclusions, this.edition), card_name)
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
let ways_card = _.find(game_cards, (card_name) => {
return _.includes(CardList.way_cards(this.exclusions, this.edition), card_name)
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76