Redundant default arguments

Stating defaults add complexity when reading the code but does not change Django's behaviour.

Python allows function arguments to have default values. The default value is used when the function is called without the argument.

Redundant default arguments are explicitly passing in default values when calling a function.

Redundant default arguments are noise. They don't add value but do add maintenance overhead. The code will execute the same without specifying them. Reduce the amount of code that needs to be read and maintained by deleting redundant default arguments.

If our GitHub code review bot spots this issue in your pull request it gives this advice:

django-doctorbotsuggested changes just now
models.py
1
+
class CommentModel(models.Model):
2
+
    body = models.TextField(null=False,editable=True)

Stating defaults add complexity when reading the code but does not change Django's behaviour.

Read more
Suggested changes
-
    body = models.TextField(null=False,editable=True)
+
    body = models.TextField()
Commit suggestion
3
+
    date = models.DateField()
Update models.py

Instantly check if you have this issue for free

    Works with tools you use

    Read about how it works.