Open Luro02 opened 5 months ago
When a sufficiently large class, has a lot of methods that take the same parameter, it would make sense to have this as an attribute.
PARAMETER_SHOULD_BE_ATTRIBUTE
oop
class A { void a(String name) { /* ... */ } void b(String name) { /* ... */ } void c(String name) { /* ... */ } void d(String name) { /* ... */ } void e(String name) { /* ... */ } void f(String name) { /* ... */ } }
Could be written as:
class A { String name; void a() { /* ... */ } void b() { /* ... */ } void c() { /* ... */ } void d() { /* ... */ } void e() { /* ... */ } void f() { /* ... */ } }
What it does
When a sufficiently large class, has a lot of methods that take the same parameter, it would make sense to have this as an attribute.
Potential Problems
Lint Name
PARAMETER_SHOULD_BE_ATTRIBUTE
Category
oop
Example
Could be written as: