too few public methods
Sylvia0696 opened this issue · 2 comments
{This is part of Bug Hunt 2 for Wei Luo (wl2671) and Zhuangyu Ren (zr2209) }
On line 6 of models.py, line 4 of apps.py, lines 5, 8, 12 and 14 of forms.py, line 9 of admin.py, line 9 of 0001_initial.py and apps.py in canvas, there are too few public methods. This basically says that classes aren't meant to just store data. Classes should have at least a few methods to operate on the data that they hold.
we also spotted that problem. As mentioned above, it indeed happens a lot of time, For example, the code below:
class UsersConfig(AppConfig):
name = 'users'
Basically, there is no need to create extra class so as to hold the name, one can just use variable or should re-factorize the code that combine several members and functions into single class.
{This is part of Bug Hunt 2 for Danyang He (dh2914) and Chi Zhang(cz2517) }
We also found the issue in users/forms.py
In class CustomUserCreationForm and its subclass Meta(UserCreationForm), there is no method defined.
The same is for class CustomUserChangeForm and subclass Meta.