A function parameter should only be read and not be modified. If your intent is to modify the value of the parameter, return the value in the function and handle the new value in the caller of the function.
Non-Compliant Code Examples
deffunc(arg1,arg2):arg1=foo# assign to a variable that is an argument
deffunc(arg1,arg2):(arg1,arg3,arg2)=foo# assign to a variable that is an argument
Compliant Code Examples
deffunc(arg1,arg2):arg3=foo
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- python-best-practices # Rules to enforce Python best practices.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines