Code Smells Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Long Method

A

Method is too long.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Large Class

A

Class has too many LoC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Feature Envy

A

Reveals a method (or method-to-be) that would work better on a different class. A method accesses the data of another object more than its own data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Case Statement

A

Happens when your next steps depend on the type of the object you operate, expressed as a case statement or a conditional.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Shotgun Surgery

A

When some logic changes, you need to change it in multiple places, which you need to be aware of.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Divergent Change

A

When there are multiple reasons for some unit to change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Long Parameter List

A

When a method has more than x parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Duplicated Code

A

When the same code is in multiple places.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Uncommunicative Name

A

When a unit’s name does not reveal its intent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Single Table Inheritance

A

When subclassing AR models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Comments.

A

When adding useless, or as a result of complexity, comments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Mixin

A

When logic shared with modules instead of class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Callback

A

Adding non-persistence-related callbacks to AR models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly