Code Smells Flashcards

1
Q

Signs that there might be something wrong with the code

A

code smells

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

Means your code is doing too much

A

Large Classes and Long Methods

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

Using primitive instead of creating own classes

A

Primitive obsession

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

Data that always appear together

A

data clumps

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

methods have too many parameters

A

Long Parameter List

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

method or class is trying to exhibit too many behaviours

A

Too many switch statements

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

When subclass does not use members inherited from a superclass

A

Refuse Bequest

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

Close related classes should share the same interface, so they can be pluggable

A

Alternative classes with different interface

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

Several classes changed for every new feauture/code

A

Shotgun surgery

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

Same class changed for different reason

A

Divergent Change

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

Class that doesnt do much

A

Lazy class

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

when the same code is repeated multiple times in different parts of the application.

A

Duplicate Code

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

Unused code

A

Dead Code

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

When a method excessively accesses the data of another class

A

Feature envy

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

When two classes are constantly accessing each other members

A

Inappropriate Intimacy

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

Ask an object to get another object

A

Message Chains

17
Q

It is important but maybe you’re doing it because the code is not readable in the firstplace

A

Too many comments